home *** CD-ROM | disk | FTP | other *** search
/ Corel Professional Photos 112: Rhinos & Hippos / Corel Professional Photos - 1994 - 112 - Rhinos and Hippos.ISO / drwmodel / custom / userproc.ps < prev    next >
Text File  |  1993-05-05  |  81KB  |  3,320 lines

  1. %%  --------------------------------------------------------------------
  2. %%  ----------- CorelDRAW! USER-DEFINED FUNCTON FILE ---------------------
  3. %%  ------File name is: USERPROC.PS------------------------------------
  4. %% NOTES:
  5.  
  6.     There are two types of user defined functions: "Spot" and "Fill"
  7.  
  8.     - A "Spot" function is a function that takes two floating point arguments,
  9.         X and Y, both between -1 and 1,  and returns a single real value between
  10.         -1 and 1 (otherwise an execution error occurs) called Z.
  11.         The domain is a 2 X 2 rectangle that will be mapped (at print time) into
  12.         each cell of the halftoning screen.
  13.         The 3-D representation of the function Z = f(X,Y) (does not need
  14.         to be continuous but f(X,Y) must be defined for all -1 <= X, Y <= 1 )
  15.         is a surface whose higher points will be whitened first in each cell.
  16.         For more information about spot functions, read section 4.8 of the
  17.         POSTSCRIPT LANGUAGE REFERENCE MANUAL (By Adobe Systems Inc.).
  18.  
  19.     - A Fill function takes between 0 and 5 arguments.  It assumes there is a
  20.         path already drawn (may be closed or not, may be disconnected) and
  21.         attempts to fill it.
  22.         A simple fill function could be:
  23.                 /MyFill1 { %0 parms
  24.                     .70 setgray fill } bind def
  25.         For more complex fills, the fill function may refer to the current
  26.         object's bounding box that is always defined in CORELDRAW units (1/1000)
  27.         of an inch and relative to the CORELDRAW logical origin.
  28.  
  29.         Globals Bbllx, Bblly, Bburx, Bbury can always be used to get the
  30.         object's bbox's lower left and upper right corners.
  31.  
  32.         NOTE 1: For objects with disconnected paths like multi-letter words
  33.         and disconnected lines & curves, the fill function will be called once
  34.         for each closed sub-path.  However, the object's bounding box remains
  35.         the same for each call.
  36.  
  37.         NOTE 2: When called by CorelDRAW!, the fill function will be inside a
  38.         "gsave - grestore" sequence so that the fill function does not need to
  39.         restore the original graphics state.  Also, the fill function should
  40.         make no assumption about the current graphics state other than the
  41.         following:    - The current rotation angle is 0 (-90 for sideways pages)
  42.                         - The current unit is the MIL (1/1000 inch)
  43.                         - There is a path ready to be filled.
  44.  
  45. SYNTAX FOR THIS FILE:
  46.     - A function definition starts with a "%@Spot" or a "%@Fill" comment line
  47.     starting in column one indicating that a spot or a fill function is about
  48.      to be defined.  The remainder of the line is ignored.
  49.     - The line immediately following must start with the function name
  50.     immediately preceeded by a '/' (slash) in column one (eg: /MyFirstFill).
  51.     This name will be used to identify the fill in the .CDR file and the
  52.     .EPS files. The remainder of the line indicates the name that appears
  53.     in the custom function selection dialog box of CorelDRAW! and the user
  54.     parameters for that function: Spot functions are not allowed any user
  55.     parameters just a display name. Fill functions are allowed from 0 to 5
  56.     parmeters specified as follows:
  57.  
  58.             %<userfnname>,<# of parms> ,<parmname1>=<default1>,<parmname2>=<default2>,...
  59.  
  60.             where: <userfnname> is the name that is displayed in the PSFILL selection
  61.                           list box, this is the string that is translated for
  62.                           foreign language versions
  63.              <# of parms> is an integer value between 0 and 5
  64.              <parmnameX> is the significance of parm X (string up to 20 chars)
  65.              <defaultX> is the default numeric value for that parm (always integer)
  66.             The number of parameter names & defaults must always match the
  67.             <# of parms> value.
  68.             Prior to calling that fill function, the main program will stack the
  69.             parameters in the same order they were specified.
  70.         ALL PARMS ARE INTEGERS.
  71.  
  72.         EXAMPLE:        a fill function with 3 parameters
  73.  
  74.         %@Fill
  75.         /MyFunction  %MyFunctionName,3,Background gray=100,Foreground gray=50,Density=4
  76.             {        % when called, STACK= <BackGray> <ForeGray> <Density>
  77.             /Density exch 1 10 InRange def        % validate density
  78.             /ForeGray exch 0 100 InRange def        % validate foreground gray
  79.             /BackGray exch 0 100 InRange def        % validate background gray
  80.             ...
  81.             } bind def
  82.  
  83.             NOTE: the 'InRange' PostScript function.
  84.             The main program cannot validate the range of the parameters.
  85.             The fill function can use the supplied function: 'InRange' which is
  86.             described below:
  87.                 <value> <min> <max> InRange  ==>  <newval>
  88.                 InRange takes 3 arguments from the stack, then makes sure that
  89.                 <value> is between <min> and <max>. If so, it leaves <value>
  90.                 on the stack, otherwise it pushes a valid <newval> on the stack.
  91.  
  92.             Note: The 'wDstChck' PostScript function.
  93.             In the case of a maximum value that equals a minimum value, the
  94.             difference will be null and in most cases will cause a devision by zero.
  95.             The fill function can use the supplied function: 'wDstChck'
  96.                         which is described below:
  97.                 <MaxValue> <MinValue> wDstChck ==> MaxValue or MaxValue+1
  98.                 If the 2 values are equal
  99.                               then add 1 to MaxValue and leave it on the stack
  100.                             else
  101.                               leave MaxValue unchanged on the stack.
  102.  
  103.     - The next n lines contain the function's body enclosed in curly
  104.     brackets and followed by a "bind def" sequence.
  105.     - The content of the body is not parsed by CorelDRAW!.  A function definition is
  106.     terminated when the next '%@..." sequence is read or at the end of the file.
  107.     - Lines should not exceed 150 characters long.
  108.     - Function names should not exceed 20 characters.
  109.     - Parameter names should not exceed 20 characters.
  110.     - There is no limit for the number of lines in each function.
  111.  
  112.  
  113. %@Spot
  114. /Dot2 %Dot2
  115.         { %def --SPOT FUNCTION : DOT2: black around cells
  116.         dup mul exch dup mul add 1 sub
  117.         } bind def
  118.  
  119. %@Spot
  120. /OutCircleBlk %OutCircleBlk
  121.         { %def --SPOT FUNCTION : OUTCIRCLE: empty black circles
  122.         dup mul exch dup mul add
  123.         0.6 exch sub abs -0.5 mul
  124.         } bind def
  125.  
  126. %@Spot
  127. /OutCircleWhi %OutCircleWhi
  128.         { %def --SPOT FUNCTION : OUTCIRCLE: empty black circles
  129.         dup mul exch dup mul add
  130.         0.6 exch sub abs 0.5 mul
  131.         } bind def
  132.  
  133. %@Spot
  134. /Diamond %Diamond
  135.         { %def --SPOT FUNCTION : DIAMOND1
  136.         abs exch abs add 1 exch sub
  137.         } bind def
  138.  
  139. %@Spot
  140. /Diamond2 %Diamond2
  141.         { %def --SPOT FUNCTION : DIAMOND2
  142.                 abs exch abs 2 copy add .75
  143.                 le {dup mul exch dup mul add 1
  144.                 exch sub} {2 copy add 1.25 
  145.                 le {.85 mul add 1 exch sub} 
  146.                 {1 sub dup mul exch 1 sub dup mul
  147.                 add 1 sub} ifelse} ifelse
  148.         } bind def
  149.  
  150. %@Spot
  151. /MicroWaves %MicroWaves
  152.         { %def --SPOT FUNCTION : MICROWAVES
  153.         /wy exch def
  154.         180 mul cos 2 div wy dup dup dup mul mul sub mul wy add
  155.         180 mul cos
  156.         } bind def
  157.  
  158. %@Spot
  159. /Grid %Grid
  160.         { % A SQUARE GRID
  161.         2 copy
  162.         abs exch abs
  163.         gt {exch} if
  164.         pop 2 mul 1 exch sub 3.5 div
  165.         } bind def
  166.  
  167. %@Spot
  168. /Lines %Lines
  169.         { % STRAIGHT LINES
  170.         pop abs 2 mul 1 exch sub
  171.         } bind def
  172.  
  173. %@Spot
  174. /Star %Star
  175.      {
  176.      abs exch abs
  177.      2 copy gt {exch} if
  178.      1  sub
  179.     dup 0 eq {0.01 add}if
  180.      atan 360 div
  181.      } bind def
  182.  
  183. %@Spot
  184. /Euclidean %Euclidean
  185.         { %def --SPOT FUNCTION : EUCLIDEAN composite dot
  186.                 abs exch abs
  187.                 2 copy add 1
  188.                 gt {1 sub dup mul
  189.                 exch 1 sub dup mul 
  190.                 add 1 sub} {dup mul exch
  191.                 dup mul add 1 exch sub}
  192.                 ifelse
  193.         } bind def
  194.  
  195. %@Spot
  196. /Rhomboid %Rhomboid
  197.              { %def --SPOT FUNCTION : RHOMBOID
  198.                 abs exch abs .8
  199.                 mul add 2 div
  200.         } bind def
  201.  
  202. %@Spot
  203. /Elliptical %Elliptical
  204.              { %def --SPOT FUNCTION : ELLIPTICAL
  205.                 dup mul .9 mul
  206.                 exch dup mul add
  207.                 1 sub
  208.         } bind def
  209.  
  210. %----------------------------------------------------------------------------
  211.  
  212. %@Fill
  213. /Archimedes %Archimedes,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  214.    {
  215.    /BackgroundGray exch -1 100 InRange def
  216.    /ForegroundGray exch 0 100 InRange def
  217.    /Linewidth      exch 0 100 InRange def
  218.    /Frequency      exch 2 100 InRange def
  219.  
  220.    /newfont 10 dict def
  221.    newfont begin
  222.  
  223.    /FontMatrix [3 sqrt 1 add 1 exch div  0  0
  224.                3 sqrt 1 add 1 exch div  0  0] def
  225.    /FontType 3 def
  226.    /FontBBox [0 0 3 sqrt 1 add 3 sqrt 1 add] def
  227.    /Encoding 256 array def
  228.    0 1 255 {Encoding exch /.notdef put} for
  229.  
  230.    /BuildChar
  231.      { 3 sqrt 1 add  0
  232.        -0.1 -0.1 3 sqrt 1.1 add 3 sqrt 1.1 add
  233.        setcachedevice
  234.        pop begin
  235.  
  236.        0 0 moveto
  237.        1 2 div  0 lineto
  238.        0  3 sqrt 2 div lineto
  239.        3 sqrt 2 div  3 sqrt 1 add 2 div lineto
  240.        0  3 sqrt 2 div 1 add lineto
  241.        0  3 sqrt 2 div lineto
  242.  
  243.        0  3 sqrt 2 div 1 add moveto
  244.        1 2 div  3 sqrt 1 add lineto
  245.        3 sqrt 1 add 2 div  3 sqrt 1 2 div add lineto
  246.        3 sqrt 2 div  3 sqrt 1 add 2 div lineto
  247.        3 sqrt 2 div 1 add  3 sqrt 1 add 2 div lineto
  248.        3 sqrt 1 add 2 div  3 sqrt 1 2 div add lineto
  249.        3 sqrt 1 2 div add  3 sqrt 1 add lineto
  250.        3 sqrt 1 add  3 sqrt 2 div 1 add lineto
  251.        3 sqrt 2 div 1 add  3 sqrt 1 add 2 div lineto
  252.        3 sqrt 1 add  3 sqrt 2 div lineto
  253.        3 sqrt 1 2 div add  0 lineto
  254.        3 sqrt 1 add 2 div  1 2 div lineto
  255.        3 sqrt 2 div 1 add  3 sqrt 1 add 2 div lineto
  256.  
  257.        3 sqrt 1 add 2 div  3 sqrt 1 add moveto
  258.        3 sqrt 1 add 2 div  3 sqrt 1 2 div add lineto
  259.  
  260.        3 sqrt 1 add 2 div  0  moveto
  261.        3 sqrt 1 add 2 div  1 2 div lineto
  262.  
  263.        1 2 div  0 moveto
  264.        3 sqrt 1 add 2 div  1 2 div lineto
  265.        3 sqrt 2 div  3 sqrt 1 add 2 div lineto
  266.  
  267.        3 sqrt 1 2 div add  0 moveto
  268.        3 sqrt 1 add  0 lineto
  269.  
  270.        3 sqrt 1 2 div add  3 sqrt 1 add moveto
  271.        3 sqrt 1 add  3 sqrt 1 add lineto
  272.  
  273.        0  3 sqrt 1 add moveto
  274.        1 2 div  3 sqrt 1 add lineto
  275.  
  276.        3 sqrt 1 add  3 sqrt 2 div moveto
  277.        3 sqrt 1 add  3 sqrt 2 div 1 add lineto
  278.  
  279.        Linewidth pntsize div 3 sqrt 1 add mul setlinewidth
  280.        stroke
  281.  
  282.       end
  283.      } def
  284.    end
  285.  
  286.    /pntsize 2000 Frequency div def
  287.    /FillFont newfont definefont pop
  288.    /FillFont findfont pntsize scalefont setfont
  289.  
  290.    eoclip
  291.    BackgroundGray 0 ge
  292.       { BackgroundGray 100 div 1 exch sub setgray fill }
  293.       { newpath } ifelse
  294.  
  295.    ForegroundGray 100 div 1 exch sub setgray
  296.  
  297.    Bblly pntsize Bbury
  298.      { Bbllx pntsize Bburx
  299.        { 1 index moveto
  300.        (a) show
  301.        } for
  302.      pop
  303.      } for
  304.    } bind def
  305.  
  306. %@Fill
  307. /Bars %Bars,4, Width=10, Spacing(%)=100, MaximumGray=100, MinimumGray=10
  308.    {
  309.    /MinGrey exch 0 100 InRange def
  310.    /MaxGrey exch MinGrey 100 InRange def
  311.    /Spacing exch 0 300 InRange def
  312.    /Width exch 1 100 InRange def
  313.  
  314.    /dgrey MaxGrey MinGrey sub def
  315.    /inc 1 Spacing 100 div add def
  316.  
  317.    eoclip newpath
  318.  
  319.    currentscreen
  320.    3 -1 roll
  321.    pop 90
  322.    3 1 roll
  323.    setscreen
  324.  
  325.    Bbllx Bblly translate
  326.    /dx Bburx Bbllx sub Width div def
  327.    /dy Bbury Bblly sub Width div def
  328.    Width 10 mul dup scale
  329.    /mtx matrix currentmatrix def
  330.    .05 setlinewidth
  331.  
  332.    0 inc dx
  333.      { 0 translate
  334.       -.5 .05 .5
  335.          { dup 0 moveto
  336.            dup dy lineto
  337.            dup mul 0.250001 exch sub sqrt 2 mul
  338.            dgrey mul MaxGrey exch sub 100 div 1 exch sub setgray
  339.            stroke
  340.          } for
  341.       mtx setmatrix
  342.       } for
  343.    dx 0 translate
  344.    90 rotate
  345.    /mtx matrix currentmatrix def
  346.    0 inc dy
  347.      { 0 translate
  348.       -.5 .05 .5
  349.          { dup 0 moveto
  350.            dup dx lineto
  351.            dup mul 0.250001 exch sub sqrt 2 mul
  352.            dgrey mul MaxGrey exch sub 100 div 1 exch sub setgray
  353.            stroke
  354.          } for
  355.       mtx setmatrix
  356.       } for
  357.    } bind def
  358.  
  359. %@Fill
  360. /Basketweave %Basketweave,4, Frequency=6, LineWidth=10, ForegroundGray=100, WeaveWidth(%)=100
  361.    {
  362.    /Width exch 1 200 InRange def
  363.    /Grey exch 0 100 InRange def
  364.    /LineWidth exch 0 100 InRange def
  365.    /Frequency exch 1 100 InRange def
  366.  
  367.    /dif Width 100 sub 100 div def
  368.  
  369.    /newfont 10 dict def
  370.    newfont begin
  371.  
  372.    /FontMatrix [.25  0
  373.                 0    .25
  374.                 0    0] def
  375.    /FontType 3 def
  376.    /FontBBox [0 0 4 4] def
  377.    /Encoding 256 array def
  378.    0 1 255 {Encoding exch /.notdef put} for
  379.    Encoding 97 /Holes put
  380.    Encoding 98 /Weave put
  381.  
  382.    /CharProcs 3 dict def
  383.    CharProcs begin
  384.    /.notdef {} def
  385.    /Holes
  386.       {
  387.       1 dif moveto
  388.       2 dif sub 1 lineto
  389.       1 2 dif sub lineto
  390.       dif 1 lineto
  391.       closepath
  392.       fill
  393.  
  394.       3 2 dif add moveto
  395.       4 dif sub 3 lineto
  396.       3 4 dif sub lineto
  397.       2 dif add 3 lineto
  398.       closepath
  399.       fill
  400.       } def
  401.    /Weave
  402.       {
  403.       0 3 dif add moveto
  404.       1 dif sub 4 lineto
  405.  
  406.       0 1 dif add moveto
  407.       1 dif lineto
  408.  
  409.       3 dif sub 4 moveto
  410.       4 dif sub 3 lineto
  411.  
  412.       1 dif sub 0 moveto
  413.       2 dif sub 1 lineto
  414.  
  415.       4 3 dif add moveto
  416.       3 2 dif add lineto
  417.  
  418.       3 dif sub 0 moveto
  419.       1 2 dif sub lineto
  420.  
  421.       4 1 dif add moveto
  422.       2 dif add 3 lineto
  423.  
  424.       dif 1 moveto
  425.       3 4 dif sub lineto
  426.  
  427.       LineWidth 100 div setlinewidth
  428.       stroke
  429.       } def
  430.    end
  431.  
  432.    /BuildChar
  433.      { 4  0
  434.        -0.1 -0.1 4.1 4.1
  435.        setcachedevice
  436.        exch begin
  437.        Encoding exch get
  438.        CharProcs exch get
  439.        end
  440.        exec
  441.      } def
  442.    end
  443.  
  444.    /pntsize 1000 Frequency div def
  445.  
  446.    /FillFont newfont definefont pop
  447.    /FillFont findfont pntsize scalefont setfont
  448.  
  449.    eoclip newpath
  450.  
  451.    Grey 100 div 1 exch sub setgray
  452.    Bblly pntsize Bbury
  453.      { Bbllx exch moveto
  454.        { (a) show
  455.          currentpoint
  456.          pop Bburx gt
  457.          {exit} if
  458.        } loop
  459.      } for
  460.  
  461.    0 setgray
  462.    Bblly pntsize Bbury
  463.      { Bbllx exch moveto
  464.        { (b) show
  465.          currentpoint
  466.          pop Bburx gt
  467.          {exit} if
  468.        } loop
  469.      } for
  470.  
  471.    } bind def
  472.  
  473. %@Fill
  474. /Birds %Birds,4, Frequency=8, LineWidth=4, ForegroundGray=100, BackgroundGray=0
  475.    {
  476.    /BackgroundGray exch -1 100 InRange def
  477.    /ForegroundGray exch 0 100 InRange def
  478.    /Linewidth      exch 0 100 InRange def
  479.    /Frequency      exch 2 100 InRange def
  480.  
  481.    /newfont 10 dict def
  482.    newfont begin
  483.  
  484.    /FontMatrix [1 162 div  0
  485.                 0         1 162 div
  486.                 0         0] def
  487.    /FontType 3 def
  488.    /FontBBox [-92 -150 46 12] def
  489.    /Encoding 256 array def
  490.    0 1 255 {Encoding exch /.notdef put} for
  491.  
  492.    /BuildChar
  493.      { 138  0
  494.        -92 -150 46 12
  495.        setcachedevice
  496.        pop begin
  497.  
  498.        -92 -150 moveto
  499.        -92 12   lineto
  500.        46  12   lineto
  501.        46 -150  lineto
  502.        closepath
  503.        clip
  504.        newpath
  505.  
  506.        2 {
  507.          gsave
  508.          3 {
  509.            -10 -8 moveto
  510.            60 24  -54 60  -9 72 curveto
  511.            -2.5 73.7  11.5 70.3  29 75.4 curveto
  512.  
  513.            -54 6 moveto
  514.            -45 14  -27 16  -18 18 curveto
  515.            27 27  -81 54  -9 90 curveto
  516.  
  517.            -126 9 moveto
  518.            -114 27  -66 66  -54 24 curveto
  519.            -53 21  -49 15  -43 12 curveto
  520.  
  521.            [ -1     0
  522.               0     1
  523.               0     0 ] concat
  524.              135 -81 translate
  525.          } repeat
  526.  
  527.        Linewidth pntsize div 162 mul setlinewidth
  528.        stroke
  529.        grestore
  530.        138 0 translate
  531.  
  532.      } repeat
  533.  
  534.      end
  535.      } def
  536.    end
  537.  
  538.    /pntsize 1174 Frequency div def
  539.  
  540.    /FillFont newfont definefont pop
  541.    /FillFont findfont pntsize scalefont setfont
  542.  
  543.    eoclip
  544.    BackgroundGray 0 ge
  545.       { BackgroundGray 100 div 1 exch sub setgray fill }
  546.       { newpath } ifelse
  547.  
  548.    ForegroundGray 100 div 1 exch sub setgray
  549.  
  550.     Bblly pntsize Bbury
  551.         { Bbllx exch moveto
  552.         { (a) show
  553.           currentpoint
  554.           pop Bburx gt
  555.           {exit} if
  556.         } loop
  557.       } for
  558.     } bind def
  559.  
  560. %@Fill
  561. /Bricks %Bricks,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  562.    {
  563.    /BackgroundGray exch -1 100 InRange def
  564.    /ForegroundGray exch 0 100 InRange def
  565.    /Linewidth      exch 0 100 InRange def
  566.    /Frequency      exch 2 100 InRange def
  567.  
  568.    /newfont 10 dict def
  569.    newfont begin
  570.  
  571.    /FontMatrix [1  0  0
  572.                 1  0  0] def
  573.    /FontType 3 def
  574.    /FontBBox [0 0 1 1] def
  575.    /Encoding 256 array def
  576.    0 1 255 {Encoding exch /.notdef put} for
  577.  
  578.    /BuildChar
  579.      { 1  0
  580.        -0.1 -0.1 1.1 1.1
  581.        setcachedevice
  582.        pop begin
  583.  
  584.        0 0 moveto
  585.        1 0 lineto
  586.        1 .5 lineto
  587.        0 .5 lineto
  588.        closepath
  589.        .5 .5 moveto
  590.        .5 1 lineto
  591.  
  592.        Linewidth pntsize div setlinewidth
  593.        stroke
  594.  
  595.       end
  596.      } def
  597.    end
  598.  
  599.    /pntsize 1000 Frequency div def
  600.  
  601.    /FillFont newfont definefont pop
  602.    /FillFont findfont pntsize scalefont setfont
  603.  
  604.    eoclip
  605.    BackgroundGray 0 ge
  606.       { BackgroundGray 100 div 1 exch sub setgray fill }
  607.       { newpath } ifelse
  608.  
  609.    ForegroundGray 100 div 1 exch sub setgray
  610.  
  611.    Bblly pntsize Bbury
  612.      { Bbllx exch moveto
  613.        { (a) show
  614.          currentpoint
  615.          pop Bburx gt
  616.          {exit} if
  617.        } loop
  618.      } for
  619.    } bind def
  620.  
  621. %@Fill
  622. /Bubbles %Bubbles,5, Number(sq_inch)=25, MaxSize=300, MinSize=10, LineWidth=10, RandomSeed=0
  623.    { srand
  624.    /LineWidth exch 0 50 InRange def
  625.    /MinSize exch 1 1000 InRange def
  626.    /MaxSize exch MinSize 1000 InRange def
  627.    /Number exch 1 250 InRange def
  628.  
  629.    eoclip
  630.    newpath
  631.    /pntsize MaxSize MinSize div cvi def
  632.    /dx Bburx Bbllx sub def
  633.    /dy Bbury Bblly sub def
  634.  
  635.    dx dy mul Number mul 1000000 div cvi
  636.    {  rand dx mod Bbllx add
  637.       rand dy mod Bblly add
  638.       rand pntsize mod 1 add pntsize exch div MinSize mul
  639.       3 copy
  640.       2 index add
  641.       exch
  642.       moveto
  643.       pop
  644.       0 360 arc
  645.       gsave
  646.       0 setgray
  647.       LineWidth setlinewidth
  648.       stroke
  649.       grestore
  650.       1 setgray
  651.       fill
  652.       } repeat
  653.  
  654.    } bind def
  655.  
  656. %@Fill
  657. /Carpet %Carpet,5, Frequency(dpi)=72, Gray=100, Gamma(box_size)=50, ModFactor=3, Alpha=10
  658.    {
  659.    /Alpha exch def
  660.    /Modf exch def
  661.    /Gamma exch def
  662.    /Grey exch 0 100 InRange def
  663.    /Frequency exch 10 300 InRange def
  664.  
  665.    /Beta1 -10 def
  666.    /Beta2 -15 def
  667.  
  668.    eoclip newpath
  669.  
  670.    /wz 360 def
  671.    2 1 Gamma sqrt
  672.       { dup Gamma exch mod
  673.       0 eq { dup wz exch mod
  674.            0 eq { /wz wz 2 index div cvi def
  675.                 } if
  676.            } if
  677.       pop
  678.       } for
  679.  
  680.    /newfont 10 dict def
  681.    newfont begin
  682.  
  683.    /FontMatrix [1 wz div  0
  684.                 0          1 wz div
  685.                 0          0] def
  686.    /FontType 3 def
  687.    /FontBBox [0 0 wz wz] def
  688.    /Encoding 256 array def
  689.    0 1 255 {Encoding exch /.notdef put} for
  690.  
  691.    /BuildChar
  692.      { wz  0
  693.        -0.1 -0.1 wz 0.1 add wz 0.1 add
  694.        setcachedevice
  695.        pop begin
  696.  
  697.       0 1 wz
  698.          { 0 1 wz
  699.             { 1 index 2 copy
  700.             Gamma mul Beta2 add sin
  701.             exch Gamma mul Beta1 add sin
  702.             add Alpha mul cvi Modf mod
  703.             0 eq { moveto
  704.                   1 0 rlineto
  705.                   0 1 rlineto
  706.                   -1 0 rlineto
  707.                   closepath
  708.                   fill }
  709.                  { pop pop } ifelse
  710.             }   for
  711.          pop
  712.          } for
  713.  
  714.        end
  715.      } def
  716.    end
  717.  
  718.    /pntsize wz 1000 mul Frequency div def
  719.  
  720.    /FillFont newfont definefont pop
  721.    /FillFont findfont pntsize scalefont setfont
  722.  
  723.    Grey 100 div 1 exch sub setgray
  724.    Bblly pntsize Bbury
  725.      { Bbllx 1 index moveto
  726.        { (a) show
  727.          currentpoint
  728.          dup 3 index sub
  729.          pntsize 2 div gt { pntsize sub } if
  730.          1 index Bburx gt
  731.          {pop pop pop exit} if
  732.          moveto
  733.        } loop
  734.      } for
  735.    } bind def
  736.  
  737. %@Fill
  738. /CircleGrid %CircleGrid,5, Frequency=6, LineWidth1=6, LineWidth2=6, Gray1=40, Gray2=40
  739.    {
  740.    /Grey2 exch -1 100 InRange def
  741.    /Grey1 exch -1 100 InRange def
  742.    /LineWidth2 exch 0 100 InRange def
  743.    /LineWidth1 exch 0 100 InRange def
  744.    /Frequency exch 1 72 InRange def
  745.  
  746.    /newfont 10 dict def
  747.    newfont begin
  748.  
  749.    /FontMatrix [1 3 sqrt 3 mul div  0
  750.                 0                   1 3 sqrt 3 mul div
  751.                 0                   0] def
  752.    /FontType 3 def
  753.    /FontBBox [0 0 2 3 sqrt 3 mul] def
  754.  
  755.    /Encoding 256 array def
  756.    0 1 255 {Encoding exch /.notdef put} for
  757.    Encoding 97 /OneCircle put
  758.    Encoding 98 /OneCircleFilled put
  759.    Encoding 99 /TwoCircles put
  760.    Encoding 100 /TwoCirclesFilled put
  761.  
  762.    /CharProcs 5 dict def
  763.    CharProcs begin
  764.    /.notdef {} def
  765.    /OneCircle
  766.      { 1 3 sqrt 2 div add  3 sqrt 5 mul 2 div moveto
  767.        1  3 sqrt 5 mul 2 div  3 sqrt 2 div 0 360 arc
  768.  
  769.        LineWidth1 pntsize div 3 sqrt 3 mul mul setlinewidth
  770.        stroke
  771.    } def
  772.  
  773.    /OneCircleFilled
  774.      { 1 3 sqrt 2 div add  3 sqrt 5 mul 2 div moveto
  775.        1  3 sqrt 5 mul 2 div  3 sqrt 2 div 0 350 arc
  776.  
  777.        fill
  778.    } def
  779.  
  780.    /TwoCircles
  781.      { 1 3 sqrt 2 div add  3 sqrt 2 div moveto
  782.        1 3 sqrt 2 div dup 0 360 arc
  783.  
  784.        1 3 sqrt 2 div add  3 sqrt 3 mul 2 div moveto
  785.        1  3 sqrt 3 mul 2 div  3 sqrt 2 div 0 360 arc
  786.  
  787.        LineWidth2 pntsize div 3 sqrt 3 mul mul setlinewidth
  788.        stroke
  789.    } def
  790.  
  791.    /TwoCirclesFilled
  792.      { 1 3 sqrt 2 div add  3 sqrt 2 div moveto
  793.        1 3 sqrt 2 div dup 0 360 arc
  794.  
  795.        1 3 sqrt 2 div add  3 sqrt 3 mul 2 div moveto
  796.        1  3 sqrt 3 mul 2 div  3 sqrt 2 div 0 360 arc
  797.  
  798.        fill
  799.    } def
  800.  
  801.    end
  802.  
  803.    /BuildChar
  804.      {3 2 div  3 sqrt 3 mul 2 div
  805.       -0.1 -0.1 2.1  3 sqrt 3 mul 0.1 add
  806.       setcachedevice
  807.       exch begin
  808.       Encoding exch get
  809.       CharProcs exch get
  810.       end
  811.       exec
  812.      }def
  813.    end
  814.  
  815.    /pntsize 3000 Frequency div def
  816.  
  817.    /FillFont newfont definefont pop
  818.    /FillFont findfont pntsize scalefont setfont
  819.  
  820.    /Bbllx Bbllx pntsize sub def
  821.    /Bblly Bblly pntsize sub def
  822.    /Bburx Bburx pntsize add def
  823.    /Bbury Bbury pntsize add def
  824.  
  825.    eoclip newpath
  826.  
  827.    Grey1 0 ge
  828.       { Grey1 100 div 1 exch sub setgray
  829.       Bblly pntsize Bbury
  830.         { Bbllx 1 index moveto
  831.           { (b) show
  832.             currentpoint
  833.             dup 3 index sub
  834.             pntsize 2.1 div gt { pntsize sub } if
  835.             1 index Bburx gt
  836.             {pop pop pop exit} if
  837.             moveto
  838.           } loop
  839.        } for
  840.       } if
  841.  
  842.    Grey2 0 ge
  843.       { Grey2 100 div 1 exch sub setgray
  844.       Bblly pntsize Bbury
  845.         { Bbllx 1 index moveto
  846.           { (d) show
  847.             currentpoint
  848.             dup 3 index sub
  849.             pntsize 2.1 div gt { pntsize sub } if
  850.             1 index Bburx gt
  851.             {pop pop pop exit} if
  852.             moveto
  853.           } loop
  854.         } for
  855.       } if
  856.  
  857.    LineWidth1 0 gt
  858.       { 0 setgray
  859.       Bblly pntsize Bbury
  860.         { Bbllx 1 index moveto
  861.           { (a) show
  862.             currentpoint
  863.             dup 3 index sub
  864.             pntsize 2.1 div gt { pntsize sub } if
  865.             1 index Bburx gt
  866.             {pop pop pop exit} if
  867.             moveto
  868.           } loop
  869.         } for
  870.       } if
  871.  
  872.    LineWidth2 0 gt
  873.       { 0 setgray
  874.       Bblly pntsize Bbury
  875.         { Bbllx 1 index moveto
  876.           { (c) show
  877.             currentpoint
  878.             dup 3 index sub
  879.             pntsize 2.1 div gt { pntsize sub } if
  880.             1 index Bburx gt
  881.             {pop pop pop exit} if
  882.             moveto
  883.           } loop
  884.         } for
  885.       } if
  886.  
  887.    } bind def
  888.  
  889. %@Fill
  890. /Construction %Construction,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  891.    {
  892.    /BackgroundGray exch -1 100 InRange def
  893.    /ForegroundGray exch 0 100 InRange def
  894.    /Linewidth      exch 0 100 InRange def
  895.    /Frequency      exch 2 100 InRange def
  896.  
  897.    /newfont 10 dict def
  898.    newfont begin
  899.  
  900.    /FontMatrix  [ .1     0
  901.                   0      .1
  902.                   0      0] def
  903.    /FontType 3 def
  904.    /FontBBox [-1 -1 9.66 11] def
  905.    /Encoding 256 array def
  906.    0 1 255 {Encoding exch /.notdef put} for
  907.  
  908.    /BuildChar
  909.      { 8.66 5
  910.        -1 -1 9.66 11
  911.        setcachedevice
  912.        pop begin
  913.  
  914.        1 0 moveto
  915.        0 0 1 -60 300 arc
  916.        3 sqrt 5 mul .5 add  5 3 sqrt 2 div sub lineto
  917.        3 sqrt 5 mul  5  1  -60 420 arc
  918.        .5  10 3 sqrt 2 div add lineto
  919.        0 10 1 60 180 arc
  920.        -1 0 lineto
  921.  
  922.        -.5 3 sqrt 2 div moveto
  923.        3 sqrt 5 mul .5 sub  5 3 sqrt 2 div add lineto
  924.        3 sqrt 5 mul .5 sub  5 3 sqrt 2 div sub moveto
  925.        -.5  10 3 sqrt 2 div sub lineto
  926.        1 10 moveto
  927.        1 0 lineto
  928.  
  929.        Linewidth pntsize div 10 mul setlinewidth
  930.        stroke
  931.       end
  932.      } def
  933.    end
  934.  
  935.    /pntsize 1126 Frequency div def
  936.    /FillFont newfont definefont pop
  937.    /FillFont findfont pntsize scalefont setfont
  938.  
  939.    /Bbllx Bbllx pntsize sub def
  940.  
  941.    eoclip
  942.    BackgroundGray 0 ge
  943.       { BackgroundGray 100 div 1 exch sub setgray fill }
  944.       { newpath } ifelse
  945.  
  946.    ForegroundGray 100 div 1 exch sub setgray
  947.  
  948.    Bblly pntsize Bbury
  949.      { Bbllx 1 index moveto
  950.        { (a) show
  951.          currentpoint
  952.          dup 3 index sub
  953.          pntsize 2.1 div gt { pntsize sub } if
  954.          1 index Bburx gt
  955.          {pop pop pop exit} if
  956.          moveto
  957.        } loop
  958.      } for
  959.    } bind def
  960.  
  961. %@Fill
  962. /Cracks %Cracks,5, Number=20, MaxLength=125, MinLength=75, StepLength=14, LineWidth=5
  963.    {
  964.    /LineWidth exch 0 100 InRange def
  965.    /StepLength exch 1 100 InRange def
  966.    /MinLength exch 1 300 InRange def
  967.    /MaxLength exch MinLength 300 InRange MinLength wDstChck def
  968.    /Number exch 1 100 InRange def
  969.  
  970.    eoclip newpath
  971.  
  972.    /dx Bburx Bbllx sub def
  973.    /dy Bbury Bblly sub def
  974.  
  975.    Number {
  976.       gsave
  977.       /theta rand 360 mod def
  978.  
  979.       rand dx mod Bbllx add
  980.       rand dy mod Bblly add
  981.       moveto
  982.  
  983.       StepLength dup scale
  984.       LineWidth StepLength div setlinewidth
  985.  
  986.       MinLength
  987.       MaxLength MinLength sub
  988.       rand 1 index mod 2 index add
  989.          {
  990.          currentpoint translate
  991.          rand 120 mod 60 sub theta add dup rotate
  992.          0 0 moveto
  993.          1 0 lineto
  994.          stroke
  995.          1 0 moveto
  996.          neg rotate
  997.          } repeat
  998.       grestore
  999.       pop pop
  1000.       } repeat
  1001.    } bind def
  1002.  
  1003. %@Fill
  1004. /Craters %Craters,5, Number=15, MaximumSize=300, MinimumSize=75, BackgroundGray=0, RandomSeed=0
  1005.    { srand
  1006.    /BackgroundGrey exch 0 100 InRange def
  1007.    /MinSize exch 1 500 InRange def
  1008.    /MaxSize exch MinSize 500 InRange MinSize wDstChck def
  1009.    /Number exch 1 50 InRange def
  1010.  
  1011.    eoclip
  1012.    BackgroundGrey 100 div 1 exch sub setgray
  1013.    fill
  1014.  
  1015.    /pntsize 333 def
  1016.    /dx Bburx Bbllx sub def
  1017.    /dy Bbury Bblly sub def
  1018.    /DifSize MaxSize MinSize sub cvi def
  1019.  
  1020.    Bbllx Bblly translate
  1021.  
  1022.    matrix currentmatrix
  1023.    dx dy mul 1000000 div Number mul cvi {
  1024.       dup
  1025.       rand dx mod  rand dy mod  translate
  1026.       /size rand DifSize mod MinSize add def
  1027.       0 0 size .7 mul  0 360 arc
  1028.       BackgroundGrey 100 div 1 exch sub setgray fill
  1029.  
  1030.       0
  1031.          { rand 18 mod add 10 add
  1032.          dup 360 gt { pop exit } if
  1033.          dup rotate
  1034.          size 5 div  0 moveto
  1035.          rand 300 mod 200 add 500 div size mul  0 lineto
  1036.          dup neg rotate
  1037.          } loop
  1038.  
  1039.       0 setgray
  1040.       1 setlinewidth
  1041.       stroke
  1042.       setmatrix
  1043.       } repeat
  1044.    pop
  1045.    } bind def
  1046.  
  1047. %@Fill
  1048. /Crosshatching %Crosshatching,5, MaxDistance=75, MinDistance=0, LineWidth=5, Angle=45, Random Seed=0
  1049.    { srand
  1050.    /Angle exch -180 180 InRange def
  1051.    /LineWidth exch 0 100 InRange def
  1052.    /MinDist exch 0 500 InRange def
  1053.    /MaxDist exch MinDist 500 InRange MinDist wDstChck def
  1054.  
  1055.    eoclip
  1056.    newpath
  1057.  
  1058.    /pntsize MaxDist MinDist sub def
  1059.    /dx2 Bburx Bbllx sub 2 div def
  1060.    /dy2 Bbury Bblly sub 2 div def
  1061.    /hyp2 dx2 dup mul dy2 dup mul add sqrt def
  1062.  
  1063.    Bbllx Bblly translate
  1064.    dx2 dy2 translate
  1065.    Angle rotate
  1066.    LineWidth setlinewidth
  1067.  
  1068.    /wd hyp2 neg def
  1069.       { /wd rand pntsize mod MinDist add wd add def
  1070.       wd hyp2 neg moveto
  1071.       wd hyp2 lineto
  1072.       stroke
  1073.       wd hyp2 gt {exit} if
  1074.       } loop
  1075.  
  1076.    Angle -2 mul rotate
  1077.    /wd hyp2 neg def
  1078.       { /wd rand pntsize mod MinDist add wd add def
  1079.       wd hyp2 neg moveto
  1080.       wd hyp2 lineto
  1081.       stroke
  1082.       wd hyp2 gt {exit} if
  1083.       } loop
  1084.  
  1085.    } bind def
  1086.  
  1087. %@Fill
  1088. /CrystalLattice %CrystalLattice,4, Frequency=4, BackGray=100, FrontGray=0, Scaling(%)=75
  1089.    {
  1090.    /Scaling exch 10 100 InRange def
  1091.    /FrontGrey exch 0 100 InRange def
  1092.    /BackGrey exch -100 100 InRange def
  1093.    /Frequency exch 1 50 InRange def
  1094.  
  1095.    /newfont 10 dict def
  1096.    newfont begin
  1097.  
  1098.    /FontMatrix [1                   0
  1099.                 0                   1
  1100.                 0                   0] def
  1101.    /FontType 3 def
  1102.    /FontBBox [0 0 1 1] def
  1103.    /Encoding 256 array def
  1104.    0 1 255 {Encoding exch /.notdef put} for
  1105.  
  1106.    /BuildChar
  1107.      { 1 0
  1108.        -0.1 -0.1 1.1 1.1
  1109.        setcachedevice
  1110.        pop begin
  1111.  
  1112.        gsave
  1113.        0 0 moveto
  1114.        3 { 1 0 lineto
  1115.          currentpoint translate
  1116.          90 rotate
  1117.          } repeat
  1118.        closepath
  1119.        .05 setlinewidth
  1120.        stroke
  1121.        grestore
  1122.  
  1123.        gsave
  1124.        4 { .2 0 moveto
  1125.          0 0 .2 0 360 arc
  1126.          fill
  1127.          1 0 translate
  1128.          90 rotate
  1129.          } repeat
  1130.        grestore
  1131.  
  1132.        end
  1133.      } def
  1134.    end
  1135.  
  1136.    /pntsize 1000 Frequency div cvi def
  1137.  
  1138.    /FillFont newfont definefont pop
  1139.    /FillFont findfont pntsize scalefont setfont
  1140.  
  1141.    /dx Bburx Bbllx sub def
  1142.    /dy Bbury Bblly sub def
  1143.  
  1144.    eoclip newpath
  1145.  
  1146.    currentscreen
  1147.    3 -1 roll
  1148.    pop 120
  1149.    3 1 roll
  1150.    setscreen
  1151.  
  1152.    Bbllx dx 2 div add  Bblly dy 2 div add translate
  1153.  
  1154.    /dx dx 100 mul Scaling div def
  1155.    /dy dy 100 mul Scaling div def
  1156.  
  1157.    Scaling 100 div dup scale
  1158.    100 Scaling div log 10 div 10 exch exp
  1159.    BackGrey 0 100 InRange 100 div  FrontGrey BackGrey sub 1000 div  FrontGrey .1 sub 100 div
  1160.       { 1 exch sub setgray
  1161.       dup dup scale
  1162.       dy 2 div cvi dup pntsize mod pntsize 2 div sub sub neg
  1163.         pntsize   dy pntsize add 2 div
  1164.         { dx 2 div cvi dup pntsize mod pntsize 2 div sub sub neg
  1165.           1 index moveto
  1166.           { (a) show
  1167.             currentpoint
  1168.             dup 3 index sub
  1169.             pntsize 2.1 div gt { pntsize sub } if
  1170.             1 index dx pntsize add 2 div gt
  1171.             { pop pop pop exit } if
  1172.             moveto
  1173.           } loop
  1174.         } for
  1175.       } for
  1176.       pop
  1177.    } bind def
  1178.  
  1179. %@Fill
  1180. /Denim %Denim,5, Frequency=72, MaxGray=100, MinGray=0, HalftoneScreen=60, RandomSeed=0
  1181.    { srand
  1182.    /Screen exch 30 300 InRange def
  1183.    /MinGrey exch 0 100 InRange def
  1184.    /MaxGrey exch MinGrey 100 InRange def
  1185.    /Frequency exch 1 300 InRange def
  1186.  
  1187.    eoclip newpath
  1188.  
  1189.    currentscreen
  1190.    3 -1 roll
  1191.    pop Screen
  1192.    3 1 roll
  1193.    setscreen
  1194.  
  1195.    /dx Bburx Bbllx sub def
  1196.    /dy Bbury Bblly sub def
  1197.    /wf Frequency 1000 div def
  1198.    /dgrey MaxGrey MinGrey sub 100 div def
  1199.  
  1200.    Bbllx Bblly translate
  1201.    /str 512 string def
  1202.  
  1203.    dx wf mul cvi 1 add  dy wf mul cvi 1 add  8  [wf 0 0 wf 0 0]
  1204.       { dgrey MinGrey 2.55 mul
  1205.       0 1 511
  1206.          { str exch
  1207.          rand -11 bitshift 255 and 4 index mul 3 index add cvi
  1208.          put
  1209.          } for
  1210.       pop pop
  1211.       str
  1212.      }image
  1213.  
  1214.    } bind def
  1215.  
  1216. %@Fill
  1217. /DNA %DNA,5, Frequency=4, LineWidth=1, ForegroundGray=100, BackgroundGray=0, Spacing(%)=100
  1218.    {
  1219.    /Spacing        exch 1 300 InRange def
  1220.    /BackgroundGray exch -1 100 InRange def
  1221.    /ForegroundGray exch 0 100 InRange def
  1222.    /Linewidth      exch 0 100 InRange def
  1223.    /Frequency      exch 1 100 InRange def
  1224.  
  1225.    /newfont 10 dict def
  1226.    newfont begin
  1227.  
  1228.    /FontMatrix [1 360 div           0
  1229.                 0                   1 360 div
  1230.                 0                   0] def
  1231.    /FontType 3 def
  1232.    /FontBBox [-20 0 20 360] def
  1233.    /Encoding 256 array def
  1234.    0 1 255 {Encoding exch /.notdef put} for
  1235.  
  1236.    /BuildChar
  1237.      { Spacing 110
  1238.        -20  0 20 360
  1239.        setcachedevice
  1240.        pop begin
  1241.  
  1242.        Linewidth pntsize mul 110 div setlinewidth
  1243.        0 0 moveto
  1244.        0 1 360
  1245.           { dup sin 20 mul exch lineto
  1246.           } for
  1247.        stroke
  1248.        20 0 moveto
  1249.        0 1 360
  1250.           { dup cos 20 mul exch lineto
  1251.           } for
  1252.        stroke
  1253.        0 20 360
  1254.           { dup dup sin 20 mul exch moveto
  1255.           dup cos 20 mul exch lineto
  1256.           } for
  1257.        stroke
  1258.  
  1259.        end
  1260.      } def
  1261.    end
  1262.  
  1263.    /pntsize 2000 Frequency div def
  1264.  
  1265.    /FillFont newfont definefont pop
  1266.    /FillFont findfont pntsize scalefont setfont
  1267.  
  1268.    eoclip
  1269.    BackgroundGray 0 ge
  1270.       { BackgroundGray 100 div 1 exch sub setgray fill }
  1271.       { newpath } ifelse
  1272.  
  1273.    ForegroundGray 100 div 1 exch sub setgray
  1274.  
  1275.    Bblly pntsize sub pntsize Bbury pntsize add
  1276.      { Bbllx 1 index moveto
  1277.        { (a) show
  1278.          currentpoint
  1279.          dup 3 index sub
  1280.          pntsize 2.1 div gt { pntsize sub } if
  1281.          1 index Bburx gt
  1282.          {pop pop pop exit} if
  1283.          moveto
  1284.        } loop
  1285.      } for
  1286.    } bind def
  1287.  
  1288. %@Fill
  1289. /Fishscale %Fishscale,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  1290.    {
  1291.    /BackgroundGray exch -1 100 InRange def
  1292.    /ForegroundGray exch 0 100 InRange def
  1293.    /Linewidth      exch 0 100 InRange def
  1294.    /Frequency      exch 2 100 InRange def
  1295.  
  1296.    /newfont 10 dict def
  1297.    newfont begin
  1298.  
  1299.    /FontMatrix [1  0  0
  1300.                 1  0  0] def
  1301.    /FontType 3 def
  1302.    /FontBBox [0 0 1 1] def
  1303.    /Encoding 256 array def
  1304.    0 1 255 {Encoding exch /.notdef put} for
  1305.  
  1306.    /BuildChar
  1307.      { 1  0
  1308.        0 0 1 1
  1309.        setcachedevice
  1310.        pop begin
  1311.  
  1312.        0.5 0.5 0.5 360 180 arcn
  1313.        0 1 0.5 270 360 arc
  1314.        1 1 0.5 180 270 arc
  1315.  
  1316.        Linewidth pntsize div setlinewidth
  1317.        stroke
  1318.  
  1319.       end
  1320.      } def
  1321.    end
  1322.  
  1323.    /pntsize 1000 Frequency div def
  1324.    /FillFont newfont definefont pop
  1325.    /FillFont findfont pntsize scalefont setfont
  1326.  
  1327.    eoclip
  1328.    BackgroundGray 0 ge
  1329.       { BackgroundGray 100 div 1 exch sub setgray fill }
  1330.       { newpath } ifelse
  1331.  
  1332.    ForegroundGray 100 div 1 exch sub setgray
  1333.  
  1334.     Bblly pntsize Bbury
  1335.       { Bbllx exch moveto
  1336.         { (a) show
  1337.           currentpoint
  1338.           pop Bburx gt
  1339.           {exit} if
  1340.         } loop
  1341.       } for
  1342.     } bind def
  1343.  
  1344.  
  1345. %@Fill
  1346. /Grass %Grass,5, Number=100, MaximumSize=35, MinimumSize=7, Gray=0, RandomSeed=0
  1347.     { srand
  1348.     /Grey exch -1 100 InRange def
  1349.     /MinSize exch 1 100 InRange def
  1350.     /MaxSize exch MinSize 100 InRange MinSize wDstChck def
  1351.     /Number exch 1 500 InRange def
  1352.  
  1353.     eoclip
  1354.     Grey 0 ge
  1355.        { Grey 100 div 1 exch sub setgray fill }
  1356.        { newpath } ifelse
  1357.  
  1358.     /Bbllx Bbllx MaxSize sub def
  1359.     /Bblly Bblly MaxSize sub def
  1360.  
  1361.     /dx Bburx Bbllx sub def
  1362.     /dy Bbury Bblly sub def
  1363.     /dSize MaxSize MinSize sub def
  1364.  
  1365.     dx dy mul 1000000 div Number mul cvi
  1366.        {
  1367.  
  1368.        matrix currentmatrix
  1369.  
  1370.        rand dx mod Bbllx add
  1371.        rand dy mod Bblly add
  1372.        translate
  1373.  
  1374.        rand dSize mod MinSize add
  1375.        dup scale
  1376.  
  1377.        -0.5 0 moveto
  1378.        rand 14 mod 7 sub
  1379.        -0.5 3  2 index 3 div 0.3 sub 10  4 index 10 curveto
  1380.        3 div 0.3 add 10 0.5 3 0.5 0 curveto
  1381.        gsave
  1382.        1 setgray
  1383.        fill
  1384.        grestore
  1385.        0.1 setlinewidth
  1386.        0 setgray
  1387.        stroke
  1388.  
  1389.        setmatrix
  1390.  
  1391.        } repeat
  1392.  
  1393.      } bind def
  1394.  
  1395. %@Fill
  1396. /Hatching %Hatching,5, MaxDistance=75, MinDistance=0, LineWidth=5, Angle=45, RandomSeed=0
  1397.    { srand
  1398.    /Angle exch -180 180 InRange def
  1399.    /LineWidth exch 0 100 InRange def
  1400.    /MinDist exch 0 500 InRange def
  1401.    /MaxDist exch MinDist 500 InRange MinDist wDstChck def
  1402.  
  1403.    eoclip
  1404.    newpath
  1405.  
  1406.    /pntsize MaxDist MinDist sub def
  1407.    /dx2 Bburx Bbllx sub 2 div def
  1408.    /dy2 Bbury Bblly sub 2 div def
  1409.    /hyp2 dx2 dup mul dy2 dup mul add sqrt def
  1410.  
  1411.    Bbllx Bblly translate
  1412.    dx2 dy2 translate
  1413.    Angle rotate
  1414.    LineWidth setlinewidth
  1415.  
  1416.    /wd hyp2 neg def
  1417.  
  1418.       { /wd rand pntsize mod MinDist add wd add def
  1419.       wd hyp2 neg moveto
  1420.       wd hyp2 lineto
  1421.       stroke
  1422.       wd hyp2 gt {exit} if
  1423.       } loop
  1424.  
  1425.    } bind def
  1426.  
  1427. %@Fill
  1428. /Hexagons %Hexagons,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  1429.    {
  1430.    /BackgroundGray exch -1 100 InRange def
  1431.    /ForegroundGray exch 0 100 InRange def
  1432.    /LineWidth      exch 0 100 InRange def
  1433.    /Frequency      exch 2 100 InRange def
  1434.  
  1435.    /newfont 10 dict def
  1436.    newfont begin
  1437.  
  1438.    /FontMatrix [1 3 sqrt div        0
  1439.                 0                   1 3 sqrt div
  1440.                 0                   0] def
  1441.    /FontType 3 def
  1442.    /FontBBox [0 0 2 3 sqrt] def
  1443.    /Encoding 256 array def
  1444.    0 1 255 {Encoding exch /.notdef put} for
  1445.  
  1446.    /BuildChar
  1447.      { 3 2 div  3 sqrt 2 div
  1448.        -0.1 -0.1 2.1 3 sqrt 0.1 add
  1449.        setcachedevice
  1450.        pop begin
  1451.  
  1452.        1 2 div  0 moveto
  1453.        3 2 div  0 lineto
  1454.        2  3 sqrt 2 div lineto
  1455.        3 2 div  3 sqrt lineto
  1456.        1 2 div  3 sqrt lineto
  1457.        0  3 sqrt 2 div lineto
  1458.        closepath
  1459.  
  1460.        LineWidth pntsize div 3 sqrt mul setlinewidth
  1461.        stroke
  1462.  
  1463.       end
  1464.      } def
  1465.    end
  1466.  
  1467.    /pntsize 1155 Frequency div def
  1468.    /FillFont newfont definefont pop
  1469.    /FillFont findfont pntsize scalefont setfont
  1470.  
  1471.    eoclip
  1472.    BackgroundGray 0 ge
  1473.       { BackgroundGray 100 div 1 exch sub setgray fill }
  1474.       { newpath } ifelse
  1475.  
  1476.    ForegroundGray 100 div 1 exch sub setgray
  1477.  
  1478.    Bblly pntsize Bbury
  1479.      { Bbllx 1 index moveto
  1480.        { (a) show
  1481.          currentpoint
  1482.          dup 3 index sub
  1483.          pntsize 2 div gt { pntsize sub } if
  1484.          1 index Bburx gt
  1485.          {pop pop pop exit} if
  1486.          moveto
  1487.        } loop
  1488.      } for
  1489.    } bind def
  1490.  
  1491. %@Fill
  1492. /Honeycomb %Honeycomb,5, Frequency=4, BackGray=100, FrontGray=0, Scaling(%)=75, LineWidth=5
  1493.    {
  1494.    /LineWidth exch 0 100 InRange def
  1495.    /Scaling exch 10 100 InRange def
  1496.    /FrontGrey exch 0 100 InRange def
  1497.    /BackGrey exch -100 100 InRange def
  1498.    /Frequency exch 1 50 InRange def
  1499.  
  1500.    /newfont 10 dict def
  1501.    newfont begin
  1502.  
  1503.    /FontMatrix [1 3 sqrt div        0
  1504.                 0                   1 3 sqrt div
  1505.                 0                   0] def
  1506.    /FontType 3 def
  1507.    /FontBBox [0 0 2 3 sqrt] def
  1508.    /Encoding 256 array def
  1509.    0 1 255 {Encoding exch /.notdef put} for
  1510.  
  1511.    /BuildChar
  1512.      { 3 2 div  3 sqrt 2 div
  1513.        -0.1 -0.1 2.1 3 sqrt 0.1 add
  1514.        setcachedevice
  1515.        pop begin
  1516.  
  1517.        1 2 div  0 moveto
  1518.        3 2 div  0 lineto
  1519.        2  3 sqrt 2 div lineto
  1520.        3 2 div  3 sqrt lineto
  1521.        1 2 div  3 sqrt lineto
  1522.        0  3 sqrt 2 div lineto
  1523.        closepath
  1524.  
  1525.        LineWidth pntsize div 3 sqrt mul setlinewidth
  1526.        stroke
  1527.  
  1528.       end
  1529.      } def
  1530.    end
  1531.  
  1532.    /pntsize 1000 Frequency div cvi def
  1533.  
  1534.    /FillFont newfont definefont pop
  1535.    /FillFont findfont pntsize scalefont setfont
  1536.  
  1537.    /dx Bburx Bbllx sub def
  1538.    /dy Bbury Bblly sub def
  1539.  
  1540.    eoclip newpath
  1541.  
  1542.    currentscreen
  1543.    3 -1 roll
  1544.    pop 120
  1545.    3 1 roll
  1546.    setscreen
  1547.  
  1548.    Bbllx dx 2 div add  Bblly dy 2 div add translate
  1549.  
  1550.    /dx dx 100 mul Scaling div def
  1551.    /dy dy 100 mul Scaling div def
  1552.  
  1553.    Scaling 100 div dup scale
  1554.    100 Scaling div log 10 div 10 exch exp
  1555.    BackGrey 0 100 InRange 100 div  FrontGrey BackGrey sub 1000 div  FrontGrey .1 sub 100 div
  1556.       { 1 exch sub setgray
  1557.       dup dup scale
  1558.       dy 2 div cvi dup pntsize mod pntsize 2 div sub sub neg
  1559.         pntsize   dy pntsize add 2 div
  1560.         { dx 2 div cvi dup pntsize mod pntsize 2 div sub sub neg
  1561.           1 index moveto
  1562.           { (a) show
  1563.             currentpoint
  1564.             dup 3 index sub
  1565.             pntsize 2.1 div gt { pntsize sub } if
  1566.             1 index dx pntsize add 2 div gt
  1567.             { pop pop pop exit } if
  1568.             moveto
  1569.           } loop
  1570.         } for
  1571.       } for
  1572.    pop
  1573.    } bind def
  1574.  
  1575. %@Fill
  1576. /Impact %Impact,5, LineWidth=5, StepLength=15, MaximumAngle=40, MinimumAngle=10, RandomSeed=0
  1577.    { srand
  1578.    /MinAng exch 2 90 InRange def
  1579.    /MaxAng exch MinAng 90 InRange MinAng wDstChck def
  1580.    /Step exch 10 500 InRange def
  1581.    /Linewidth exch 0 100 InRange def
  1582.  
  1583.    eoclip
  1584.    newpath
  1585.  
  1586.    /dx Bburx Bbllx sub def
  1587.    /dy Bbury Bblly sub def
  1588.    /DifAng MaxAng MinAng sub def
  1589.  
  1590.    Bbllx Bblly translate
  1591.  
  1592.    dx 2 div  dy 2 div  translate
  1593.    Linewidth Step div setlinewidth
  1594.    Step Step scale
  1595.  
  1596.    /theta 0 def
  1597.       { matrix currentmatrix
  1598.       /theta theta rand DifAng mod add MinAng add def
  1599.       theta 360 gt {pop exit} if
  1600.       theta rotate
  1601.       0 0 moveto
  1602.       rand 150 mod 50 add
  1603.          {
  1604.          currentpoint translate
  1605.          rand 120 mod 60 sub theta add dup rotate
  1606.          1 0 lineto
  1607.          neg rotate
  1608.          } repeat
  1609.       stroke
  1610.       setmatrix
  1611.       } loop
  1612.    } bind def
  1613.  
  1614.  
  1615. %@Fill
  1616. /Landscape %Landscape,4, Depth=6, MaximumGray=100, MinimumGray=0, RandomSeed=0
  1617.    {
  1618.    srand
  1619.    /MinGrey exch 0 100 InRange def
  1620.    /MaxGrey exch MinGrey 100 InRange def
  1621.    /maxdepth exch 1 7 InRange def
  1622.  
  1623.    /dGrey MaxGrey MinGrey sub 200 div def
  1624.    /AvGrey MaxGrey MinGrey add 200 div def
  1625.  
  1626.    eoclip newpath
  1627.    /depth 0 def
  1628.    /ardepth 2 maxdepth 1 sub exp cvi def
  1629.    /height 1.8 8 maxdepth sub exp def
  1630.  
  1631.    /horz 0 def
  1632.    /vert 0 def
  1633.    /Array ardepth 1 add array def
  1634.    0 1 ardepth
  1635.       { Array exch ardepth 1 add array put
  1636.       } for
  1637.    0 1 ardepth
  1638.       { Array exch get
  1639.       0 1 ardepth
  1640.          { 2 copy 0 put
  1641.          pop
  1642.          } for
  1643.       pop
  1644.       } for
  1645.  
  1646.    /Square
  1647.       {
  1648.       /depth depth 1 add def
  1649.       depth maxdepth eq
  1650.       {
  1651.       Array horz get vert get dup 1 add dup moveto                    %ur
  1652.       Array horz 1 add get vert get dup 1 add lineto             %ul
  1653.       Array horz 1 add get vert 1 add get dup dup lineto         %ll
  1654.       Array horz get vert 1 add get dup 1 add exch lineto             %lr
  1655.       closepath
  1656.       sub
  1657.       dGrey mul AvGrey add
  1658.       setgray
  1659.       fill }
  1660.  
  1661.       {
  1662.       /wd 2 maxdepth depth sub 1 sub exp cvi def
  1663.  
  1664.       Array horz wd 2 mul add get vert wd 2 mul add get
  1665.       Array horz get vert wd 2 mul add get
  1666.       Array horz wd 2 mul add get vert get
  1667.       Array horz get vert get
  1668.  
  1669.       4 copy add add add 4 div
  1670.             rand 50 mod 25 sub height div 2 depth exp div add
  1671.       Array horz wd add get
  1672.             vert wd add 2 index put  pop
  1673.  
  1674.       3 index 2 index add 2 div
  1675.             rand 50 mod 25 sub height div 2 depth exp div add
  1676.       Array horz wd 2 mul add get
  1677.             vert wd add 2 index put   pop
  1678.  
  1679.       3 index 3 index add 2 div
  1680.             rand 50 mod 25 sub height div 2 depth exp div add
  1681.       Array horz wd add get
  1682.             vert wd 2 mul add 2 index put   pop
  1683.  
  1684.       horz 0 eq
  1685.       { 2 index 1 index add 2 div
  1686.             rand 50 mod 25 sub height div 2 depth exp div add
  1687.       Array horz get
  1688.             vert wd add 2 index put    pop
  1689.       } if
  1690.  
  1691.       vert 0 eq
  1692.       { 1 index 1 index add 2 div
  1693.             rand 50 mod 25 sub height div 2 depth exp div add
  1694.       Array horz wd add get
  1695.             vert 2 index put          pop
  1696.       } if
  1697.  
  1698.       pop pop pop pop
  1699.       .5 .5 translate
  1700.       .5 .5 scale
  1701.       Square
  1702.       2 2 scale
  1703.  
  1704.       /horz horz 2 maxdepth depth sub 1 sub exp cvi add def
  1705.       -.5 0 translate
  1706.       .5 .5 scale
  1707.       Square
  1708.       2 2 scale
  1709.       /horz horz 2 maxdepth depth sub 1 sub exp cvi sub def
  1710.  
  1711.       /vert vert 2 maxdepth depth sub 1 sub exp cvi add def
  1712.       .5 -.5 translate
  1713.       .5 .5 scale
  1714.       Square
  1715.       2 2 scale
  1716.       /vert vert 2 maxdepth depth sub 1 sub exp cvi sub def
  1717.  
  1718.       /horz horz 2 maxdepth depth sub 1 sub exp cvi add def
  1719.       /vert vert 2 maxdepth depth sub 1 sub exp cvi add def
  1720.       -.5 0 translate
  1721.       .5 .5 scale
  1722.       Square
  1723.       2 2 scale
  1724.       /horz horz 2 maxdepth depth sub 1 sub exp cvi sub def
  1725.       /vert vert 2 maxdepth depth sub 1 sub exp cvi sub def
  1726.  
  1727.       } ifelse
  1728.       /depth depth 1 sub def
  1729.  
  1730.    } def
  1731.  
  1732.    /dx Bburx Bbllx sub def
  1733.    /dy Bbury Bblly sub def
  1734.    /hyp dx dup mul dy dup mul add sqrt def
  1735.    Bbllx dx 2 div add  Bblly dy 2 div add translate
  1736.    hyp 1.2 mul dup scale
  1737.    45 rotate
  1738.    -.5 -.5 translate
  1739.  
  1740.    currentscreen
  1741.    3 -1 roll
  1742.    pop 120
  1743.    3 1 roll
  1744.    setscreen
  1745.  
  1746.    0 0 0 0
  1747.    Square
  1748.    4{ pop }repeat
  1749.  
  1750.    } bind def
  1751.  
  1752. %@Fill
  1753. /Leaves %Leaves,5, Number(sq_inch)=50, MaximumGray=100, MinimumGray=0, MaximumSize=100, MinimumSize=10
  1754.    {
  1755.    /MinSize exch 1 200 InRange def
  1756.    /MaxSize exch MinSize 200 InRange MinSize wDstChck def
  1757.    /MinGrey exch 0 100 InRange def
  1758.    /MaxGrey exch MinGrey 100 InRange def
  1759.    /Number exch 1 250 InRange def
  1760.  
  1761.    eoclip newpath
  1762.    currentscreen
  1763.    3 -1 roll
  1764.    pop 90
  1765.    3 1 roll
  1766.    setscreen
  1767.  
  1768.    /dx Bburx Bbllx sub def
  1769.    /dy Bbury Bblly sub def
  1770.  
  1771.    dx dy mul Number mul 1000000 div cvi
  1772.       {
  1773.       matrix currentmatrix
  1774.  
  1775.       rand dx mod Bbllx add
  1776.       rand dy mod Bblly add
  1777.       translate
  1778.  
  1779.       rand 360 mod
  1780.       rotate
  1781.  
  1782.       MaxSize MinSize eq
  1783.         { Maxsize 10.8 div }
  1784.         { rand MaxSize MinSize sub mod MinSize add 10.8 div } ifelse
  1785.       dup scale
  1786.  
  1787.       17 0 moveto
  1788.       65 -18 106 -13 125 0 curveto
  1789.       106 13  65  18  17 0 curveto
  1790.       gsave
  1791.       MaxGrey MinGrey eq
  1792.         { MaxGrey 100 div }
  1793.         { rand MaxGrey MinGrey sub mod MinGrey add 100 div } ifelse
  1794.       setgray
  1795.       fill
  1796.       grestore
  1797.       0.3 setlinewidth
  1798.       0 setgray
  1799.       stroke
  1800.  
  1801.       setmatrix
  1802.  
  1803.       } repeat
  1804.  
  1805.    } bind def
  1806.  
  1807. %@Fill
  1808. /Mesh %Mesh,5, Frequency=6, SquareSize(%)=80, ShadowLowerLeft=3, ShadowUpperRight=15, ForegroundGray=100
  1809.    {
  1810.    /ForegroundGray exch 0 100 InRange def
  1811.    /Shadow2 exch 0 100 InRange def
  1812.    /Shadow1 exch 0 100 InRange def
  1813.    /SquareSize exch 1 100 InRange def
  1814.    /Frequency exch 1 25 InRange def
  1815.  
  1816.    /newfont 10 dict def
  1817.    newfont begin
  1818.  
  1819.    /FontMatrix [1         0
  1820.                 0         1
  1821.                 0         0] def
  1822.    /FontType 3 def
  1823.    /FontBBox [0 0 1 1] def
  1824.    /Encoding 256 array def
  1825.    0 1 255 {Encoding exch /.notdef put} for
  1826.  
  1827.    /BuildChar
  1828.      { 1  0
  1829.        -0.1 -0.1 1.1 1.1
  1830.        setcachedevice
  1831.        pop begin
  1832.  
  1833.        0 setlinejoin
  1834.  
  1835.        SquareSize 100 div dup scale
  1836.        0 0 moveto
  1837.        1 0 lineto
  1838.        1 1 lineto
  1839.        0 1 lineto
  1840.        closepath
  1841.  
  1842.        Shadow1 100 div
  1843.        1 Shadow2 100 div sub
  1844.        1 index dup moveto
  1845.        1 index 1 index lineto
  1846.        dup dup lineto
  1847.        dup 2 index lineto
  1848.        closepath
  1849.        2{pop}repeat
  1850.        fill
  1851.  
  1852.        end
  1853.      } def
  1854.    end
  1855.  
  1856.    /pntsize 1000 Frequency div def
  1857.  
  1858.    /FillFont newfont definefont pop
  1859.    /FillFont findfont pntsize scalefont setfont
  1860.  
  1861.    eoclip newpath
  1862.  
  1863.    ForegroundGray 100 div 1 exch sub setgray
  1864.  
  1865.    Bblly pntsize Bbury
  1866.      { Bbllx exch moveto
  1867.        { (a) show
  1868.          currentpoint
  1869.          pop Bburx gt
  1870.          {exit} if
  1871.        } loop
  1872.      } for
  1873.    } bind def
  1874.  
  1875. %@Fill
  1876. /Motifs %Motifs,4, Motif=1, Frequency=2, Spacing(%)=100, ForegroundGray=100
  1877.    {
  1878.    /ForegroundGray exch 0 100 InRange def
  1879.    /Spacing exch 1 300 InRange def
  1880.    /Frequency exch 1 25 InRange def
  1881.    /Character exch 1 8 InRange def
  1882.  
  1883.    /str 1 string def
  1884.    str 0 Character put
  1885.  
  1886.    /newfont 10 dict def
  1887.    newfont begin
  1888.  
  1889.    /FontMatrix [.001                0
  1890.                 0                   .001
  1891.                 0                   0] def
  1892.    /FontType 3 def
  1893.    /FontBBox [0 0 500 1000] def
  1894.  
  1895.    /Encoding 256 array def
  1896.    0 1 255 {Encoding exch /.notdef put} for
  1897.    Encoding  1 /CanadianFlag put
  1898.    Encoding  2 /Corels put
  1899.    Encoding  3 /Globe put
  1900.    Encoding  4 /CubeSolid put
  1901.    Encoding  5 /CubeFrame put
  1902.    Encoding  6 /Balls put
  1903.    Encoding  7 /Checkerboard put
  1904.    Encoding  8 /CCCTlogo put
  1905.  
  1906.    /CharProcs 9 dict def
  1907.    CharProcs begin
  1908.    /.notdef {} def
  1909.    /CanadianFlag
  1910.      { 9.6 9.6 scale
  1911.        9 -30 translate
  1912.  
  1913.        -9 60 moveto
  1914.        -9 30 lineto
  1915.        -1 30 lineto
  1916.        -1 60 lineto
  1917.        closepath
  1918.  
  1919.        43 60 moveto
  1920.        43 30 lineto
  1921.        35 30 lineto
  1922.        35 60 lineto
  1923.        closepath
  1924.  
  1925.        17 58 moveto
  1926.        15 54 lineto
  1927.        12 55 lineto
  1928.        14 47 lineto
  1929.        10 51 lineto
  1930.        10 49 lineto
  1931.        05 50 lineto
  1932.        07 45 lineto
  1933.        05 45 lineto
  1934.        12 39 lineto
  1935.        10 37 lineto
  1936.        16.5 38 lineto
  1937.        16.5 32 lineto
  1938.        17.5 32 lineto
  1939.        17.5 38 lineto
  1940.        24 37 lineto
  1941.        22 39 lineto
  1942.        29 45 lineto
  1943.        27 45 lineto
  1944.        29 50 lineto
  1945.        24 49 lineto
  1946.        24 51 lineto
  1947.        20 47 lineto
  1948.        22 55 lineto
  1949.        19 54 lineto
  1950.        closepath
  1951.  
  1952. %       0.3 setlinewidth
  1953. %       stroke
  1954.        fill
  1955.        } def
  1956.    /Corels
  1957.        { 250 250 translate
  1958.        113 113 scale
  1959.  
  1960.        7 { 45 rotate
  1961.          gsave
  1962.          1 2 sqrt div 1 add 0 translate
  1963.          .5 .5 moveto
  1964.          -.5 .5 lineto
  1965.          -.5 -.5 lineto
  1966.          .5 -.5 lineto
  1967.          closepath
  1968.          fill
  1969.          grestore
  1970.          } repeat
  1971.        } def
  1972.    /Globe
  1973.        {
  1974.        250 250 translate
  1975.        250 250 scale
  1976.        0 1 4
  1977.           { matrix currentmatrix exch
  1978.           22.5 mul sin
  1979.           1 scale
  1980.           0 0 1 90 450 arc
  1981.           setmatrix
  1982.           } for
  1983.  
  1984.        -3 1 3
  1985.           { 22.5 mul sin
  1986.           dup
  1987.           dup mul 1 sub neg sqrt
  1988.           dup neg 2 index moveto
  1989.           exch lineto
  1990.           } for
  1991.  
  1992.        .01 setlinewidth
  1993.        stroke
  1994.        } def
  1995.    /CubeSolid
  1996.        {
  1997.        250 250 translate
  1998.        145 145 scale
  1999.        /Rotm
  2000.           { 30 matrix rotate transform
  2001.           exch 3 1 roll
  2002.           30 matrix rotate transform
  2003.           pop exch
  2004.           moveto
  2005.           } bind def
  2006.        /Rotl
  2007.           { 30 matrix rotate transform
  2008.           exch 3 1 roll
  2009.           30 matrix rotate transform
  2010.           pop exch
  2011.           lineto
  2012.           } bind def
  2013.  
  2014.         1  1  1 Rotm
  2015.        -1  1  1 Rotl
  2016.        -1 -1  1 Rotl
  2017.         1 -1  1 Rotl
  2018.        closepath
  2019.  
  2020.        -1  1  1 Rotm
  2021.        -1  1 -1 Rotl
  2022.         1  1 -1 Rotl
  2023.         1 -1 -1 Rotl
  2024.         1 -1  1 Rotl
  2025.  
  2026.         1  1  1 Rotm
  2027.         1  1 -1 Rotl
  2028.  
  2029.        .01 setlinewidth
  2030.        stroke
  2031.        } def
  2032.    /CubeFrame
  2033.        {
  2034.        250 250 translate
  2035.        145 145 scale
  2036.        /Rotm
  2037.           { 30 matrix rotate transform
  2038.           exch 3 1 roll
  2039.           30 matrix rotate transform
  2040.           pop exch
  2041.           moveto
  2042.           } bind def
  2043.        /Rotl
  2044.           { 30 matrix rotate transform
  2045.           exch 3 1 roll
  2046.           30 matrix rotate transform
  2047.           pop exch
  2048.           lineto
  2049.           } bind def
  2050.  
  2051.         1  1  1 Rotm
  2052.        -1  1  1 Rotl
  2053.        -1 -1  1 Rotl
  2054.         1 -1  1 Rotl
  2055.        closepath
  2056.  
  2057.         1  1 -1 Rotm
  2058.        -1  1 -1 Rotl
  2059.        -1 -1 -1 Rotl
  2060.         1 -1 -1 Rotl
  2061.        closepath
  2062.  
  2063.         1  1  1 Rotm
  2064.         1  1 -1 Rotl
  2065.        -1  1  1 Rotm
  2066.        -1  1 -1 Rotl
  2067.        -1 -1  1 Rotm
  2068.        -1 -1 -1 Rotl
  2069.         1 -1  1 Rotm
  2070.         1 -1 -1 Rotl
  2071.  
  2072.        .01 setlinewidth
  2073.        stroke
  2074.        } def
  2075.    /Balls
  2076.        { 250 250 translate
  2077.        225 225 scale
  2078.  
  2079.        0 0 1.1 0 360 arc
  2080.        -0.32  0.55 translate
  2081.        30 rotate
  2082.        1 2 div  1 3 div scale
  2083.        0 0 1.1 360 0 arcn
  2084.        fill
  2085.        } def
  2086.    /Checkerboard
  2087.        { 0 0 moveto
  2088.        500 0 lineto
  2089.        500 500 lineto
  2090.        0 500 lineto
  2091.        closepath
  2092.        fill
  2093.        } def
  2094.    /CCCTlogo
  2095.        {
  2096.        4.8 4.8 scale
  2097.        -21 -26 translate
  2098.  
  2099.        36.4 28.4 moveto
  2100.        70 38 35 196 176.7 arcn
  2101.        35.1 40 35 42 24 41 curveto
  2102.        21 37 24 38 22 32 curveto
  2103.        21 28 25 27 28 28 curveto
  2104.        33 26 32 30 36.4 28.4 curveto
  2105.  
  2106.        36.5 48.2 moveto
  2107.        70 38 35 163.1 144.5 arcn
  2108.        40 59 39 60 36 61 curveto
  2109.        33 63 29 62 27 61 curveto
  2110.        24 58 29 55 26 54 curveto
  2111.        24 53 25 50 25 50 curveto
  2112.        28 47 30 44 36.5 48.2 curveto
  2113.  
  2114.        44.3 61.7 moveto
  2115.        70 38 35 137.3 111.5 arcn
  2116.        56 81 52 75 53 81 curveto
  2117.        52 87 50 81 46 84 curveto
  2118.        37 84 40 80 40 76 curveto
  2119.        42 70 35 73 44.3 61.7 curveto
  2120.  
  2121.        60.8 71.8 moveto
  2122.        70 38 35 105.3 80.0 arcn
  2123.        78 72 78 76 77 80 curveto
  2124.        77 81 80 82 79 83 curveto
  2125.        77 85 74 84 70 85 curveto
  2126.        65 85 69 80 62 80 curveto
  2127.        59 77 61 74 60.8 71.8 curveto
  2128.  
  2129.        97.1 60.1 moveto
  2130.        70 38 35 39.2 66.4 arc
  2131.        81 74 82 78 85 81 curveto
  2132.        91 81 98 84 95 76 curveto
  2133.        98 74 115 77 103 72 curveto
  2134.        101 68 100 61 97.1 60.1 curveto
  2135.  
  2136.        100 56 moveto
  2137.        70 38 35 31 11.6 arcn
  2138.        113 42 114 49 118 50 curveto
  2139.        115 57 123 56 120 60 curveto
  2140.        115 60 116 64 109 63 curveto
  2141.        104 62 107 57 100 56 curveto
  2142.  
  2143.        105 39 moveto
  2144.        70 38 35 1.6 -14.8 arcn
  2145.        107 27 110 28 112 27 curveto
  2146.        115 27 111 31 118 32 curveto
  2147.        120 33 125 33 122 36 curveto
  2148.        121 37 119 38 117 39 curveto
  2149.        113 46 112 39 105 39 curveto
  2150.  
  2151.        fill
  2152.     } def
  2153.    end
  2154.  
  2155.    /BuildChar
  2156.      {Spacing 100 div 500 mul  dup
  2157.       -0.1 -0.1 500.1 1000.1
  2158.       setcachedevice
  2159.       exch begin
  2160.       Encoding exch get
  2161.       CharProcs exch get
  2162.       end
  2163.       exec
  2164.      }def
  2165.    end
  2166.  
  2167.    /pntsize 100000 Frequency div Spacing div def
  2168.  
  2169.    /FillFont newfont definefont pop
  2170.    /FillFont findfont pntsize scalefont setfont
  2171.  
  2172.    /increment Spacing 100 div pntsize mul def
  2173.  
  2174.    eoclip newpath
  2175.    ForegroundGray 100 div 1 exch sub setgray
  2176.    Bblly increment Bbury
  2177.      { Bbllx 1 index moveto
  2178.        { str show
  2179.          currentpoint
  2180.          dup 3 index sub
  2181.          increment 2.1 div gt { increment sub } if
  2182.          1 index Bburx gt
  2183.          {pop pop pop exit} if
  2184.          moveto
  2185.        } loop
  2186.      } for
  2187.    } bind def
  2188.  
  2189. %@Fill
  2190. /Octagons %Octagons,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  2191.    {
  2192.    /BackgroundGray exch -1 100 InRange def
  2193.    /ForegroundGray exch 0 100 InRange def
  2194.    /Linewidth      exch 0 100 InRange def
  2195.    /Frequency      exch 2 100 InRange def
  2196.  
  2197.    /newfont 10 dict def
  2198.    newfont begin
  2199.  
  2200.    /FontMatrix [1 2 sqrt 1 add div  0
  2201.                 0                   1 2 sqrt 1 add div
  2202.                 0                   0] def
  2203.    /FontType 3 def
  2204.    /FontBBox [0 0 2 sqrt 1 add 2 sqrt 1 add] def
  2205.    /Encoding 256 array def
  2206.    0 1 255 {Encoding exch /.notdef put} for
  2207.  
  2208.    /BuildChar
  2209.      { 2 sqrt 1 add  0
  2210.        -0.5 -0.5 2 sqrt 1.5 add 2 sqrt 1.5 add
  2211.        setcachedevice
  2212.        pop begin
  2213.  
  2214.        1 2 sqrt div  0 moveto
  2215.        1 2 sqrt div 1 add  0 lineto
  2216.        2 sqrt 1 add  1 2 sqrt div lineto
  2217.        2 sqrt 1 add  1 2 sqrt div 1 add lineto
  2218.        1 2 sqrt div 1 add  2 sqrt 1 add lineto
  2219.        1 2 sqrt div  2 sqrt 1 add lineto
  2220.        0  1 2 sqrt div 1 add lineto
  2221.        0  1 2 sqrt div lineto
  2222.        closepath
  2223.  
  2224.        Linewidth pntsize div 2 sqrt 1 add mul setlinewidth
  2225.        stroke
  2226.  
  2227.       end
  2228.      } def
  2229.    end
  2230.  
  2231.    /pntsize 1000 Frequency div def
  2232.    /FillFont newfont definefont pop
  2233.    /FillFont findfont pntsize scalefont setfont
  2234.  
  2235.    eoclip
  2236.    BackgroundGray 0 ge
  2237.       { BackgroundGray 100 div 1 exch sub setgray fill }
  2238.       { newpath } ifelse
  2239.  
  2240.    ForegroundGray 100 div 1 exch sub setgray
  2241.  
  2242.    Bblly pntsize Bbury
  2243.      { Bbllx pntsize Bburx
  2244.        { 1 index moveto
  2245.        (a) show
  2246.        } for
  2247.      pop
  2248.      } for
  2249.    } bind def
  2250.  
  2251. %@Fill
  2252. /Patio %Patio,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  2253.    {
  2254.    /BackgroundGray exch -1 100 InRange def
  2255.    /ForegroundGray exch 0 100 InRange def
  2256.    /Linewidth      exch 0 100 InRange def
  2257.    /Frequency      exch 2 100 InRange def
  2258.  
  2259.    /newfont 10 dict def
  2260.    newfont begin
  2261.  
  2262.    /FontMatrix [2 7 div             0
  2263.                 0                   2 7 div
  2264.                 0                   0] def
  2265.    /FontType 3 def
  2266.    /FontBBox [0 0 3 sqrt 2 mul  7 2 div] def
  2267.    /Encoding 256 array def
  2268.    0 1 255 {Encoding exch /.notdef put} for
  2269.  
  2270.    /BuildChar
  2271.      { 3 sqrt 3 mul 2 div  3 2 div
  2272.        -0.5 -0.5 3 sqrt 2 mul 0.5 add 7 2 div 0.5 add
  2273.        setcachedevice
  2274.        pop begin
  2275.  
  2276.        3 sqrt  3 2 div  translate
  2277.        3 sqrt 2 div  1 2 div  moveto
  2278.        3 { 120 rotate
  2279.            3 sqrt 2 div  -3 2 div lineto
  2280.            3 sqrt  -1 lineto
  2281.            3 sqrt  0 lineto
  2282.            3 sqrt 2 div  1 2 div lineto
  2283.          } repeat
  2284.  
  2285.        Linewidth pntsize div 7 2 div mul setlinewidth
  2286.        stroke
  2287.  
  2288.        end
  2289.      } def
  2290.    end
  2291.  
  2292.    /pntsize 1250 Frequency div def
  2293.  
  2294.    /FillFont newfont definefont pop
  2295.    /FillFont findfont pntsize scalefont setfont
  2296.  
  2297.    /Pointsize pntsize 6 mul 7 div def
  2298.  
  2299.    eoclip
  2300.    BackgroundGray 0 ge
  2301.       { BackgroundGray 100 div 1 exch sub setgray fill }
  2302.       { newpath } ifelse
  2303.  
  2304.    ForegroundGray 100 div 1 exch sub setgray
  2305.  
  2306.    Bblly Pointsize Bbury
  2307.      { Bbllx 1 index moveto
  2308.        { (a) show
  2309.          currentpoint
  2310.          dup 3 index sub
  2311.          Pointsize 2 div gt { Pointsize sub } if
  2312.          1 index Bburx gt
  2313.          {pop pop pop exit} if
  2314.          moveto
  2315.        } loop
  2316.      } for
  2317.    } bind def
  2318.  
  2319. %@Fill
  2320. /Rectangles %Rectangles,5, Area=100, Number=50, Linewidth=5, Gray=0, RandomSeed=0
  2321.    {
  2322.    srand
  2323.    /Grey exch 0 100 InRange def
  2324.    /Linewidth exch 0 100 InRange def
  2325.    /Number exch 1 200 InRange def
  2326.    /area exch 10 300 InRange def
  2327.  
  2328.    /dx Bburx Bbllx sub 2 mul def
  2329.    /dy Bbury Bblly sub 2 mul def
  2330.    /Area area 10000 mul def
  2331.  
  2332.    eoclip newpath
  2333.  
  2334.    Linewidth setlinewidth
  2335.    Bbllx dx 2 div sub  Bblly dy 2 div sub  translate
  2336.  
  2337. %   Area log
  2338.    Number {
  2339.       rand dx mod rand dy mod moveto
  2340. %      rand 180 mod 90 sub 100 div dup  dup mul 1 exch sub sqrt
  2341. %      exch atan 180 div 1 index mul 10 exch exp
  2342.       rand Area mod rand Area mod mul sqrt sqrt
  2343.       dup 0 rlineto
  2344.       0 Area 2 index div rlineto
  2345.       dup neg 0 rlineto
  2346.       closepath
  2347.       pop
  2348.  
  2349.       gsave
  2350.       Grey 100 div 1 exch sub setgray
  2351.       fill
  2352.       grestore
  2353.       0 setgray
  2354.       stroke
  2355.       } repeat
  2356.  
  2357.    } bind def
  2358.  
  2359. %@Fill
  2360. /Reptiles %Reptiles,5, Frequency=4, Gray1=60, Gray2=30, Gray3=0, LineWidth=8
  2361. {
  2362.   /LineWidth exch 0 250 InRange def
  2363.   /Gray3 exch 0 100 InRange 100 div def
  2364.   /Gray2 exch -1 100 InRange 100 div def
  2365.   /Gray1 exch -1 100 InRange 100 div def
  2366.   /Frequency exch 1 100 InRange def
  2367.  
  2368.   /newfont 10 dict def
  2369.   newfont begin
  2370.  
  2371.   /FontMatrix [2 7 div             0
  2372.                0                   2 7 div
  2373.                0                   0] def
  2374.   /FontType 3 def
  2375.   /FontBBox [-1.73 -1.86 2.36 2.0] def
  2376.   /Encoding 256 array def
  2377.   0 1 255 {Encoding exch /.notdef put} for
  2378.   Encoding 97 /ReptilesStroked put
  2379.   Encoding 98 /ReptileFilled put
  2380.  
  2381.   /CharProcs 3 dict def
  2382.   CharProcs begin
  2383.   /.notdef {} def
  2384.   /ReptilesStroked
  2385.   {
  2386.     %3 sqrt  3 2 div  translate
  2387.  
  2388.     3 sqrt 2 div  1 2 div  moveto
  2389.     3
  2390.     {
  2391.       120 rotate
  2392.  
  2393.       0     0    moveto
  2394.       0.32 -0.40 lineto
  2395.       0.32 -0.48 lineto
  2396.       0    -0.72 lineto
  2397.  
  2398.       0.05 -1.03 moveto
  2399.       0.4  -0.76 lineto
  2400.       0.84 -0.84 lineto
  2401.       0.5  -0.96 lineto
  2402.       0.31 -1.18 lineto
  2403.  
  2404.       0.87 -1.5  moveto
  2405.       0.58 -1.28 lineto
  2406.       0.8  -1.14 lineto
  2407.       0.94 -1.18 lineto
  2408.       1.24 -1.08 lineto
  2409.       1.42 -1.18 lineto
  2410.  
  2411.       1.68 -1.02 moveto
  2412.       1.52 -0.84 lineto
  2413.       1.64 -0.66 lineto
  2414.       1.73 -0.36 lineto
  2415.  
  2416.       1.73  0    moveto
  2417.       1.41 -0.26 lineto
  2418.       1.32 -0.49 lineto
  2419.       1.06 -0.24 lineto
  2420.       1.42  0.18 lineto
  2421.  
  2422.       0.87  0.57 moveto
  2423.       0.87  0.26 lineto
  2424.       0.99  0.26 lineto
  2425.       1.05  0.12 lineto
  2426.       0.82 -0.07 lineto
  2427.       0.68 -0.07 lineto
  2428.       0.62  0.36 lineto
  2429.  
  2430.  
  2431.       3 sqrt 2 div  1 2 div moveto
  2432.  
  2433.     } repeat
  2434.  
  2435.     LineWidth Pointsize div 7 2 div mul setlinewidth
  2436.     stroke
  2437.  
  2438.   } def
  2439.   /ReptileFilled
  2440.   {
  2441.     0     0    moveto
  2442.     0.32 -0.40 lineto
  2443.     0.32 -0.48 lineto
  2444.     0    -0.72 lineto
  2445.  
  2446.    -0.40 -0.55 lineto
  2447.    -0.47 -0.68 lineto
  2448.    -0.42 -0.97 lineto
  2449.    -0.27 -0.99 lineto
  2450.    -0.21 -0.88 lineto
  2451.  
  2452.     0.05 -1.03 lineto
  2453.     0.4  -0.76 lineto
  2454.     0.84 -0.84 lineto
  2455.     0.5  -0.96 lineto
  2456.     0.31 -1.18 lineto
  2457.  
  2458.     0.32 -1.39 lineto
  2459.     0.55 -1.60 lineto
  2460.     0.59 -1.74 lineto
  2461.     0.82 -1.86 lineto
  2462.  
  2463.     0.87 -1.5  lineto
  2464.     0.58 -1.28 lineto
  2465.     0.8  -1.14 lineto
  2466.     0.94 -1.18 lineto
  2467.     1.24 -1.08 lineto
  2468.     1.42 -1.18 lineto
  2469.     1.52 -1.45 lineto
  2470.     1.45 -1.81 lineto
  2471.     1.74 -1.47 lineto
  2472.     1.68 -1.02 lineto
  2473.     1.52 -0.84 lineto
  2474.     1.64 -0.66 lineto
  2475.     1.73 -0.36 lineto
  2476.     2.28 -0.46 lineto
  2477.     2.36 -0.11 lineto
  2478.     2.12 -0.15 lineto
  2479.     1.73  0    lineto
  2480.     1.41 -0.26 lineto
  2481.     1.32 -0.49 lineto
  2482.     1.06 -0.24 lineto
  2483.     1.42  0.18 lineto
  2484.     1.21  0.41 lineto
  2485.     1.11  0.60 lineto
  2486.  
  2487.     0.87  0.57 lineto
  2488.     0.87  0.26 lineto
  2489.     0.99  0.26 lineto
  2490.     1.05  0.12 lineto
  2491.     0.82 -0.07 lineto
  2492.     0.68 -0.07 lineto
  2493.     0.62  0.36 lineto
  2494.     0.26  0.52 lineto
  2495.     0.19  0.48 lineto
  2496.     closepath
  2497.     fill
  2498.   } def
  2499.   end
  2500.  
  2501.   /BuildChar
  2502.   {
  2503.     3 sqrt 3 mul 2 div  3 2 div
  2504.     -1.83 -1.96 2.46 2.1
  2505.     setcachedevice
  2506.     exch begin
  2507.     Encoding exch get
  2508.     CharProcs exch get
  2509.     end
  2510.     exec
  2511.   } def
  2512.   end
  2513.  
  2514.   /Pointsize 2000 Frequency div def
  2515.  
  2516.   /FillFont newfont definefont pop
  2517.   /FillFont findfont Pointsize scalefont setfont
  2518.  
  2519.   /pntsize Pointsize 6 mul 7 div def
  2520.   /HeightDiff Pointsize 2 mul 7 div .49 mul def
  2521.  
  2522.   eoclip newpath
  2523.  
  2524.   currentscreen
  2525.   3 -1 roll
  2526.   pop 120
  2527.   3 1 roll
  2528.   setscreen
  2529.  
  2530.   Bblly pntsize Bbury pntsize add HeightDiff add
  2531.   {
  2532.     Bbllx 1 index moveto
  2533.     {
  2534.       currentpoint
  2535.       1 index exch
  2536.  
  2537.       2 copy 2 copy translate
  2538.       240 rotate
  2539.       Gray1 0 ge
  2540.       { Gray1 1 exch sub setgray
  2541.         (b) show
  2542.       } if
  2543.       0 0 moveto
  2544.       -240 rotate
  2545.       neg exch neg exch translate
  2546.  
  2547.       2 copy translate
  2548.       120 rotate
  2549.       Gray2 0 ge
  2550.       { Gray2 1 exch sub setgray
  2551.         (b) show
  2552.       } if
  2553.       0 0 moveto
  2554.       -120 rotate
  2555.       neg exch neg exch translate
  2556.  
  2557.       Gray3 1 exch sub setgray
  2558.       (b) show
  2559.  
  2560.       currentpoint
  2561.       dup 4 index sub
  2562.       pntsize 2.1 div gt { pntsize sub } if
  2563.       3 -1 roll Bburx gt
  2564.       {pop pop pop exit} if
  2565.       moveto
  2566.     } loop
  2567.   } for
  2568.  
  2569.   LineWidth 0 gt
  2570.   {
  2571.     0 setgray
  2572.     Bblly pntsize Bbury pntsize add
  2573.     {
  2574.       Bbllx 1 index moveto
  2575.       {
  2576.         (a) show
  2577.         currentpoint
  2578.         dup 3 index sub
  2579.         pntsize 2.1 div gt { pntsize sub } if
  2580.         1 index Bburx gt
  2581.         {pop pop pop exit} if
  2582.         moveto
  2583.       } loop
  2584.     } for
  2585.   } if
  2586. } bind def
  2587.  
  2588. %@Fill
  2589. /SpiderWeb %SpiderWeb,5, LineWidth=5, Separation=300, MaximumAngle=40, MinimumAngle=10, RandomSeed=0
  2590.    { srand
  2591.    /MinAng exch 2 90 InRange def
  2592.    /MaxAng exch MinAng 90 InRange MinAng wDstChck def
  2593.    /Sep exch 10 500 InRange def
  2594.    /Linewidth exch 0 100 InRange def
  2595.  
  2596.    eoclip
  2597.    newpath
  2598.  
  2599.    /dx Bburx Bbllx sub def
  2600.    /dy Bbury Bblly sub def
  2601.    /hyp dx dup mul dy dup mul add sqrt def
  2602.    /DifAng MaxAng MinAng sub def
  2603.  
  2604.    Bbllx Bblly translate
  2605.    dx 2 div dy 2 div translate
  2606.  
  2607.    /theta 0 def
  2608.    /dtheta 0 def
  2609.  
  2610.    {  0 0 moveto
  2611.  
  2612.       /theta theta dtheta add def
  2613.       theta 360 ge
  2614.         { exit } if
  2615.       /dtheta rand DifAng mod MinAng add def
  2616.       theta dtheta add 350 gt
  2617.         { /dtheta 360 theta sub def } if
  2618.  
  2619.       hyp theta cos mul hyp theta sin mul lineto
  2620.  
  2621.       0 Sep hyp
  2622.          {
  2623.          dup theta cos mul
  2624.          1 index theta sin mul
  2625.          moveto
  2626.  
  2627.          dup theta dtheta add cos theta cos add mul
  2628.          1 index theta dtheta add sin theta sin add mul
  2629.          2 index
  2630.          theta 180 add dtheta add
  2631.          theta 180 add
  2632.          arcn
  2633.  
  2634.          pop
  2635.          } for
  2636.       Linewidth setlinewidth
  2637.       stroke
  2638.       } loop
  2639.    } bind def
  2640.  
  2641. %@Fill
  2642. /Spirals %Spirals,4, Size=150, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  2643.    {
  2644.    /BackgroundGrey exch -1 100 InRange def
  2645.    /ForegroundGray exch 0 100 InRange def
  2646.    /Linewidth exch 0 100 InRange def
  2647.    /Size exch 10 500 InRange def
  2648.  
  2649.    eoclip
  2650.    BackgroundGrey 0 ge
  2651.       { BackgroundGrey 100 div 1 exch sub setgray fill }
  2652.       { newpath } ifelse
  2653.  
  2654.    /cx Bburx Bbllx add 2 div def
  2655.    /cy Bbury Bblly add 2 div def
  2656.    /pntsize2 Size 2 div def
  2657.    /cy2 cy pntsize2 add def
  2658.    /hyp Bburx Bbllx sub dup mul
  2659.         Bbury Bblly sub dup mul
  2660.         add sqrt 2 div def
  2661.  
  2662.    ForegroundGray 100 div 1 exch sub setgray
  2663.  
  2664.    Linewidth setlinewidth
  2665.    0 Size hyp
  2666.       { cx cy 2 index 90 270 arc
  2667.         cx cy2 2 index pntsize2 add -90 90 arc
  2668.         pop
  2669.       } for
  2670.    stroke
  2671.    } bind def
  2672.  
  2673. %@Fill
  2674. /Spokes %Spokes,5, Number=120, LineWidth=5, Horizontal=0, Vertical=0, ForegroundGray=100
  2675.         { %def -- Fill function that fills with spokes
  2676.         /ForegroundGray exch 0 100 InRange def
  2677.     /wY exch 0 100 InRange def
  2678.     /wX exch 0 100 InRange def
  2679.     /LineWidth exch 0 100 InRange def
  2680.     /Number exch 4 360 InRange def
  2681.  
  2682.         eoclip
  2683.         newpath
  2684.         /Flen Bburx Bbllx sub dup mul Bbury Bblly sub dup mul add sqrt def
  2685.         Bbllx Bblly translate
  2686.     Bburx Bbllx sub wX mul 100 div  Bbury Bblly sub wY mul 100 div translate
  2687.  
  2688.     360 Number div
  2689.         Number {
  2690.            0 0 moveto
  2691.            Flen 0 lineto
  2692.            dup rotate
  2693.            } repeat
  2694.         pop
  2695.         ForegroundGray 100 div 1 exch sub setgray
  2696.     LineWidth setlinewidth
  2697.     stroke
  2698.         } bind def
  2699.  
  2700. %@Fill
  2701. /Squares %Squares,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  2702.    {
  2703.    /BackgroundGray exch -1 100 InRange def
  2704.    /ForegroundGray exch 0 100 InRange def
  2705.    /Linewidth      exch 0 100 InRange def
  2706.    /Frequency      exch 2 100 InRange def
  2707.  
  2708.    /newfont 10 dict def
  2709.    newfont begin
  2710.  
  2711.    /FontMatrix [1  0  0
  2712.                 1  0  0] def
  2713.    /FontType 3 def
  2714.    /FontBBox [0 0 1 1] def
  2715.    /Encoding 256 array def
  2716.    0 1 255 {Encoding exch /.notdef put} for
  2717.  
  2718.    /BuildChar
  2719.      { 1  0
  2720.        -0.1 -0.1 1.1 1.1
  2721.        setcachedevice
  2722.        pop begin
  2723.  
  2724.        0 0 moveto
  2725.        0 1 lineto
  2726.        1 1 lineto
  2727.        1 0 lineto
  2728.  
  2729.        Linewidth pntsize div setlinewidth
  2730.        stroke
  2731.  
  2732.       end
  2733.      } def
  2734.    end
  2735.  
  2736.    /pntsize 1000 Frequency div def
  2737.  
  2738.    /FillFont newfont definefont pop
  2739.    /FillFont findfont pntsize scalefont setfont
  2740.  
  2741.    eoclip
  2742.    BackgroundGray 0 ge
  2743.       { BackgroundGray 100 div 1 exch sub setgray fill }
  2744.       { newpath } ifelse
  2745.  
  2746.    ForegroundGray 100 div 1 exch sub setgray
  2747.  
  2748.    Bblly pntsize Bbury
  2749.      { Bbllx exch moveto
  2750.        { (a) show
  2751.          currentpoint
  2752.          pop Bburx gt
  2753.          {exit} if
  2754.        } loop
  2755.      } for
  2756.    } bind def
  2757.  
  2758. %@Fill
  2759. /StarOfDavid %StarOfDavid,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  2760.    {
  2761.    /BackgroundGray exch -1 100 InRange def
  2762.    /ForegroundGray exch 0 100 InRange def
  2763.    /Linewidth      exch 0 100 InRange def
  2764.    /Frequency      exch 2 100 InRange def
  2765.  
  2766.    /newfont 10 dict def
  2767.    newfont begin
  2768.  
  2769.    /FontMatrix [1 3 sqrt 2 mul div  0
  2770.                 0                   1 3 sqrt 2 mul div
  2771.                 0                   0] def
  2772.    /FontType 3 def
  2773.    /FontBBox [0 0 2 3 sqrt 2 mul] def
  2774.    /Encoding 256 array def
  2775.    0 1 255 {Encoding exch /.notdef put} for
  2776.  
  2777.    /BuildChar
  2778.      { 1  3 sqrt
  2779.        -0.1 -0.1 2.1 3 sqrt 2 mul 0.1 add
  2780.        setcachedevice
  2781.        pop begin
  2782.  
  2783.        1 2 div  0 moveto
  2784.        3 2 div  0 lineto
  2785.        2  3 sqrt 2 div lineto
  2786.        3 2 div  3 sqrt lineto
  2787.        1 2 div  3 sqrt lineto
  2788.        0  3 sqrt 2 div lineto
  2789.        closepath
  2790.  
  2791.        Linewidth pntsize div 3 sqrt 2 mul mul setlinewidth
  2792.        stroke
  2793.  
  2794.       end
  2795.      } def
  2796.    end
  2797.  
  2798.    /pntsize 1732 Frequency div def
  2799.  
  2800.    /FillFont newfont definefont pop
  2801.    /FillFont findfont pntsize scalefont setfont
  2802.  
  2803.    eoclip
  2804.    BackgroundGray 0 ge
  2805.       { BackgroundGray 100 div 1 exch sub setgray fill }
  2806.       { newpath } ifelse
  2807.  
  2808.    ForegroundGray 100 div 1 exch sub setgray
  2809.  
  2810.    Bblly pntsize Bbury
  2811.      { Bbllx pntsize sub 1 index moveto
  2812.        { (a) show
  2813.          currentpoint
  2814.          dup 3 index sub
  2815.          pntsize 2.1 div gt { pntsize sub } if
  2816.          1 index Bburx gt
  2817.          {pop pop pop exit} if
  2818.          moveto
  2819.        } loop
  2820.      } for
  2821.    } bind def
  2822.  
  2823. %@Fill
  2824. /Stars %Stars,4, Number=100, MaximumSize=300, MinimumSize=3, RandomSeed=0
  2825.    { srand
  2826.    /MinSize exch 1 1000 InRange def
  2827.    /MaxSize exch MinSize 1000 InRange def
  2828.    /Number exch 1 2000 InRange def
  2829.  
  2830.    /newfont 10 dict def
  2831.    newfont begin
  2832.  
  2833.    /FontMatrix [1  0  0
  2834.                 1  0  0] def
  2835.    /FontType 3 def
  2836.    /FontBBox [0 0 1 1] def
  2837.    /Encoding 256 array def
  2838.    0 1 255 {Encoding exch /.notdef put} for
  2839.  
  2840.    /BuildChar
  2841.      { 1  0
  2842.        -0.1 -0.1 1.1 1.1
  2843.        setcachedevice
  2844.        pop begin
  2845.  
  2846.        1 .5 moveto
  2847.        .5 .5 .5 0 360 arc
  2848.        fill
  2849.  
  2850.        end
  2851.      } def
  2852.    end
  2853.  
  2854.    /FillFont newfont definefont pop
  2855.    /FillFont findfont 2 scalefont setfont
  2856.  
  2857.    /dx Bburx Bbllx sub def
  2858.    /dy Bbury Bblly sub def
  2859.  
  2860.    eoclip
  2861.    0 setgray
  2862.    fill
  2863.  
  2864.    1 setgray
  2865.    /mtx matrix currentmatrix def
  2866.    dx dy mul Number mul 100000 div cvi
  2867.       { rand dx mod Bbllx add
  2868.       rand dy mod Bblly add
  2869.       moveto
  2870.       MaxSize rand  MaxSize MinSize div cvi  mod 1 add div 10 div
  2871.       dup scale
  2872.       (a) show
  2873.       mtx setmatrix
  2874.       } repeat
  2875.  
  2876.    } bind def
  2877.  
  2878. %@Fill
  2879. /StarShapes %StarShapes,5, Points=5, Frequency=2, Spacing=100, Angle=36, Gray=100
  2880.    {
  2881.    /Grey exch 0 100 InRange def
  2882.    /Theta exch 1 90 InRange def
  2883.    /Spacing exch 1 300 InRange def
  2884.    /Frequency exch 1 25 InRange def
  2885.    /Points exch 1 15 InRange def
  2886.  
  2887.    /str 1 string def
  2888.    str 0 Points put
  2889.  
  2890.    /newfont 10 dict def
  2891.    newfont begin
  2892.  
  2893.    /FontMatrix [.001                0
  2894.                 0                   .001
  2895.                 0                   0] def
  2896.    /FontType 3 def
  2897.    /FontBBox [0 0 500 1000] def
  2898.  
  2899.    /Encoding 256 array def
  2900.    0 1 255 {Encoding exch /.notdef put} for
  2901.  
  2902.    /BuildChar
  2903.      {Spacing 100 div 500 mul  dup
  2904.       -0.1 -0.1 500.1 1000.1
  2905.       setcachedevice
  2906.       exch begin
  2907.  
  2908.       250 250 translate
  2909.       250 250 scale
  2910.       90 rotate
  2911.  
  2912.       dup
  2913.       180 exch div dup sin exch cos div
  2914.       Theta 2 div dup sin exch cos div
  2915.  
  2916.       1 0 moveto
  2917.       2 index
  2918.          {
  2919.          360 3 index div rotate
  2920.          dup dup 3 index add div
  2921.          dup 3 index mul neg
  2922.          lineto
  2923.          1 0 lineto
  2924.          } repeat
  2925.       closepath
  2926.  
  2927.       fill
  2928.       pop pop pop
  2929.  
  2930.       end
  2931.      }def
  2932.    end
  2933.  
  2934.    /pntsize 100000 Frequency div Spacing div def
  2935.  
  2936.    /FillFont newfont definefont pop
  2937.    /FillFont findfont pntsize scalefont setfont
  2938.  
  2939.    /increment Spacing 100 div pntsize mul def
  2940.  
  2941.    eoclip newpath
  2942.  
  2943.    Grey 100 div 1 exch sub setgray
  2944.    Bblly increment Bbury
  2945.      { Bbllx 1 index moveto
  2946.        { str show
  2947.          currentpoint
  2948.          dup 3 index sub
  2949.          increment 2.1 div gt { increment sub } if
  2950.          1 index Bburx gt
  2951.          {pop pop pop exit} if
  2952.          moveto
  2953.        } loop
  2954.      } for
  2955.    } bind def
  2956.  
  2957. %@Fill
  2958. /StoneWall %StoneWall,4, Frequency=15, MaximumGray=100, MinimumGray=0, LineWidth=5
  2959.    {
  2960.    /Linewidth exch 0 100 InRange def
  2961.    /MinGrey exch 0 100 InRange def
  2962.    /MaxGrey exch MinGrey 100 InRange def
  2963.    /Frequency exch 1 50 InRange def
  2964.  
  2965.    /DifGrey MaxGrey MinGrey sub def
  2966.    DifGrey 0 eq
  2967.       { /DifGrey 1 def
  2968.       } if
  2969.    Linewidth Frequency mul 250 div setlinewidth
  2970.    eoclip newpath
  2971.    0 srand
  2972.  
  2973.    currentscreen
  2974.    3 -1 roll
  2975.    pop 100
  2976.    3 1 roll
  2977.    setscreen
  2978.  
  2979.    /dy Bbury Bblly sub def
  2980.    /dx Bburx Bbllx sub def
  2981.    Bbllx Bbury translate
  2982.    250 Frequency div dup scale
  2983.  
  2984.    dy 920 div Frequency mul cvi {
  2985.       0 0 moveto
  2986.       /x0 0 def
  2987.       /y0 0 def
  2988.       /x1 0 def
  2989.       /y1 0 def
  2990.       /x2 0 def
  2991.       /y2 0 def
  2992.       /x3 0 def
  2993.       /y3 0 def
  2994.       0 5 dx 200 div Frequency mul
  2995.          { rand 50 mod 25 div 1 sub add
  2996.          x3 y3 moveto
  2997.          x2 y2 x1 y1 x0 y0 curveto
  2998.          dup rand 30 mod 15 div neg 2 sub
  2999.          2 copy
  3000.          /y0 exch def
  3001.          /x0 exch def
  3002.          lineto
  3003.          dup rand 50 mod 10 div 2.5 sub add rand 50 mod 10 div neg
  3004.          1 index rand 50 mod 10 div
  3005.          4 index rand 30 mod 15 div 2 add
  3006.          6 copy
  3007.          /y3 exch def
  3008.          /x3 exch def
  3009.          /y2 exch def
  3010.          /x2 exch def
  3011.          /y1 exch def
  3012.          /x1 exch def
  3013.          curveto
  3014.          pop
  3015.          closepath
  3016.          gsave
  3017.          rand DifGrey mod MinGrey add 100 div 1 exch sub setgray fill
  3018.          grestore
  3019.          0 setgray stroke
  3020.          } for
  3021.       0 -4 translate
  3022.       } repeat
  3023.    } bind def
  3024.  
  3025. %@Fill
  3026. /Text %Text,5, Font=1, Character=67, Frequency=4, Spacing=100, BackgroundGray=0
  3027.    {
  3028.    /BackGrey exch -1 100 InRange def
  3029.    /Spacing exch 30 300 InRange def
  3030.    /Frequency exch 1 50 InRange def
  3031.    /Character exch 33 255 InRange def
  3032.    /Font exch 1 35 InRange def
  3033.  
  3034.    /pntsize 100000 Frequency div Spacing div def
  3035.    Font  1 eq { /Times-Roman } if
  3036.    Font  2 eq { /Times-Italic } if
  3037.    Font  3 eq { /Times-Bold } if
  3038.    Font  4 eq { /Times-BoldItalic } if
  3039.    Font  5 eq { /Helvetica } if
  3040.    Font  6 eq { /Helvetica-Oblique } if
  3041.    Font  7 eq { /Helvetica-Bold } if
  3042.    Font  8 eq { /Helvetica-BoldOblique } if
  3043.    Font  9 eq { /Courier } if
  3044.    Font 10 eq { /Courier-Oblique } if
  3045.    Font 11 eq { /Courier-Bold } if
  3046.    Font 12 eq { /Courier-BoldOblique } if
  3047.    Font 13 eq { /Symbol } if
  3048.    Font 14 eq { /AvantGarde-Book } if
  3049.    Font 15 eq { /AvantGarde-BookOblique } if
  3050.    Font 16 eq { /AvantGarde-Demi } if
  3051.    Font 17 eq { /AvantGarde-DemiOblique } if
  3052.    Font 18 eq { /Bookman-Demi } if
  3053.    Font 19 eq { /Bookman-DemiItalic } if
  3054.    Font 20 eq { /Bookman-Light } if
  3055.    Font 21 eq { /Bookman-LightItalic } if
  3056.    Font 22 eq { /Helvetica-Narrow } if
  3057.    Font 23 eq { /Helvetica-Narrow-Bold } if
  3058.    Font 24 eq { /Helvetica-Narrow-BoldOblique } if
  3059.    Font 25 eq { /Helvetica-Narrow-Oblique } if
  3060.    Font 26 eq { /NewCenturySchlbk-Roman } if
  3061.    Font 27 eq { /NewCenturySchlbk-Bold } if
  3062.    Font 28 eq { /NewCenturySchlbk-Italic } if
  3063.    Font 29 eq { /NewCenturySchlbk-BoldItalic } if
  3064.    Font 30 eq { /Palatino-Roman } if
  3065.    Font 31 eq { /Palatino-Bold } if
  3066.    Font 32 eq { /Palatino-Italic } if
  3067.    Font 33 eq { /Palatino-BoldItalic } if
  3068.    Font 34 eq { /ZapfChancery-MediumItalic } if
  3069.    Font 35 eq { /ZapfDingbats } if
  3070.    findfont pntsize scalefont setfont
  3071.  
  3072.    /str 1 string def
  3073.    str 0 Character put
  3074.  
  3075.    /increment Spacing 100 div pntsize mul 2 mul def
  3076.  
  3077.    eoclip
  3078.    BackGrey 0 ge
  3079.       { BackGrey 100 div 1 exch sub setgray fill }
  3080.       { newpath } ifelse
  3081.  
  3082.    /Bbury Bbury pntsize add def
  3083.  
  3084.    0 setgray
  3085.    Bblly increment Bbury
  3086.      { Bbllx 1 index moveto
  3087.        { str show
  3088.          currentpoint increment 2 div add
  3089.          dup 3 index sub
  3090.          increment 2.1 div gt { increment sub } if
  3091.          1 index Bburx gt
  3092.          {pop pop pop exit} if
  3093.          moveto
  3094.        } loop
  3095.      } for
  3096.    } bind def
  3097.  
  3098. %@Fill
  3099. /Tiles %Tiles,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  3100.    {
  3101.    /BackgroundGray exch -1 100 InRange def
  3102.    /ForegroundGray exch 0 100 InRange def
  3103.    /Linewidth      exch 0 100 InRange def
  3104.    /Frequency      exch 2 100 InRange def
  3105.  
  3106.    /newfont 10 dict def
  3107.    newfont begin
  3108.  
  3109.    /FontMatrix [1  0  0
  3110.                 1  0  0] def
  3111.    /FontType 3 def
  3112.    /FontBBox [0 0 2 1] def
  3113.    /Encoding 256 array def
  3114.    0 1 255 {Encoding exch /.notdef put} for
  3115.  
  3116.    /BuildChar
  3117.      { 2  .5
  3118.        -0.1 -0.1 2.1 1.1
  3119.        setcachedevice
  3120.        pop begin
  3121.  
  3122.        0   0 moveto
  3123.        1.5 0 lineto
  3124.        1.75  0 .25 180 90 arcn
  3125.        1.75 .5 .25 -90 90 arc
  3126.        1.75  1 .25 270 180 arcn
  3127.        0   1 lineto
  3128.  
  3129.        Linewidth pntsize div setlinewidth
  3130.        stroke
  3131.  
  3132.        end
  3133.      } def
  3134.    end
  3135.  
  3136.    /pntsize 500 Frequency div def
  3137.  
  3138.    /FillFont newfont definefont pop
  3139.    /FillFont findfont pntsize scalefont setfont
  3140.  
  3141.    eoclip
  3142.    BackgroundGray 0 ge
  3143.       { BackgroundGray 100 div 1 exch sub setgray fill }
  3144.       { newpath } ifelse
  3145.  
  3146.    ForegroundGray 100 div 1 exch sub setgray
  3147.  
  3148.    Bblly pntsize Bbury
  3149.      { Bbllx 1 index moveto
  3150.        { (a) show
  3151.          currentpoint
  3152.          dup 3 index sub
  3153.          pntsize 2.1 div gt { pntsize sub } if
  3154.          1 index Bburx gt
  3155.          {pop pop pop exit} if
  3156.          moveto
  3157.        } loop
  3158.      } for
  3159.    } bind def
  3160.  
  3161. %@Fill
  3162. /TreeRings %TreeRings,5, MaxDistance=150, MinDistance=0, LineWidth=5, BackgroundGray=0, RandomSeed=0
  3163.    { srand
  3164.    /BackGrey exch -1 100 InRange def
  3165.    /LineWidth exch 0 100 InRange def
  3166.    /MinDist exch 0 500 InRange def
  3167.    /MaxDist exch MinDist 500 InRange MinDist wDstChck def
  3168.  
  3169.    eoclip
  3170.    BackGrey 0 ge
  3171.       { BackGrey 100 div 1 exch sub setgray fill }
  3172.       { newpath } ifelse
  3173.  
  3174.    /cx Bburx Bbllx add 2 div def
  3175.    /cy Bbury Bblly add 2 div def
  3176.    /pntsize MaxDist MinDist sub def
  3177.    /hyp Bburx Bbllx sub dup mul Bbury Bblly sub dup mul add sqrt def
  3178.  
  3179.    /wr 0 def
  3180.    0 setgray
  3181.    LineWidth setlinewidth
  3182.  
  3183.       {
  3184.       /wr rand pntsize mod MinDist add wr add def
  3185.       cx wr add  cy moveto
  3186.       cx cy wr 0 360 arc
  3187.       stroke
  3188.       wr hyp gt {exit} if
  3189.       } loop
  3190.    } bind def
  3191.  
  3192. %@Fill
  3193. /Triangle %Triangle,4, Frequency=8, LineWidth=5, ForegroundGray=100, BackgroundGray=0
  3194.    {
  3195.    /BackgroundGray exch -1 100 InRange def
  3196.    /ForegroundGray exch 0 100 InRange def
  3197.    /Linewidth      exch 0 100 InRange def
  3198.    /Frequency      exch 2 100 InRange def
  3199.  
  3200.    /newfont 10 dict def
  3201.    newfont begin
  3202.  
  3203.    /FontMatrix  [ 1 3 sqrt div  0
  3204.                   0             1 3 sqrt div
  3205.                   0             0] def
  3206.    /FontType 3 def
  3207.    /FontBBox [0 0 1 3 sqrt] def
  3208.    /Encoding 256 array def
  3209.    0 1 255 {Encoding exch /.notdef put} for
  3210.  
  3211.    /BuildChar
  3212.      { 1  0
  3213.        -0.1 -0.1 1.1 3 sqrt 0.1 add
  3214.        setcachedevice
  3215.        pop begin
  3216.  
  3217.        0 0 moveto
  3218.        1 3 sqrt lineto
  3219.        0 3 sqrt lineto
  3220.        1 0 lineto
  3221.        closepath
  3222.  
  3223.        0 3 sqrt 2 div moveto
  3224.        1 3 sqrt 2 div lineto
  3225.  
  3226.        Linewidth pntsize div 3 sqrt mul setlinewidth
  3227.        stroke
  3228.  
  3229.       end
  3230.      } def
  3231.    end
  3232.  
  3233.    /pntsize 1732 Frequency div def
  3234.    /FillFont newfont definefont pop
  3235.    /FillFont findfont pntsize scalefont setfont
  3236.  
  3237.    eoclip
  3238.    BackgroundGray 0 ge
  3239.       { BackgroundGray 100 div 1 exch sub setgray fill }
  3240.       { newpath } ifelse
  3241.  
  3242.    ForegroundGray 100 div 1 exch sub setgray
  3243.  
  3244.    Bblly pntsize Bbury
  3245.      { Bbllx pntsize sub pntsize 3 sqrt div Bburx
  3246.        { 1 index moveto
  3247.        (a) show
  3248.        } for
  3249.      pop
  3250.      } for
  3251.    } bind def
  3252.  
  3253. %@Fill
  3254. /Waves %Waves,5, Frequency=6, LineWidth=5, ForegroundGray=100, BackgroundGray=0, Spacing(%)=100
  3255.    {
  3256.    /Spacing        exch 30 300 InRange def
  3257.    /BackgroundGray exch -1 100 InRange def
  3258.    /ForegroundGray exch 0 100 InRange def
  3259.    /Linewidth      exch  0 100 InRange def
  3260.    /Frequency      exch  2 100 InRange def
  3261.  
  3262.    /newfont 10 dict def
  3263.    newfont begin
  3264.  
  3265.    /FontMatrix [1 84 div   0
  3266.                 0          1 84 div
  3267.                 0          0] def
  3268.    /FontType 3 def
  3269.    /FontBBox [37 56 111 114] def
  3270.    /Encoding 256 array def
  3271.    0 1 255 {Encoding exch /.notdef put} for
  3272.  
  3273.    /BuildChar
  3274.      { 74  0
  3275.        36.9 55.9 111.1 114.1
  3276.        setcachedevice
  3277.        pop begin
  3278.  
  3279.        1 1.5 scale
  3280.  
  3281.        37 38 moveto
  3282.        76 38 79 73 111 57 curveto
  3283.        80 60 80 38 111 38 curveto
  3284.  
  3285.        Linewidth pntsize div 84 mul setlinewidth
  3286.        stroke
  3287.  
  3288.       end
  3289.      } def
  3290.    end
  3291.  
  3292.    /pntsize 783 Frequency div def
  3293.  
  3294.    /FillFont newfont definefont pop
  3295.    /FillFont findfont pntsize scalefont setfont
  3296.  
  3297.    /Height pntsize Spacing 100 div mul def
  3298.  
  3299.    /Bbllx Bbllx Height sub def
  3300.    /Bblly Bblly Height sub def
  3301.    /Bburx Bburx Height add def
  3302.    /Bbury Bbury Height add def
  3303.  
  3304.    eoclip
  3305.    BackgroundGray 0 ge
  3306.       { BackgroundGray 100 div 1 exch sub setgray fill }
  3307.       { newpath } ifelse
  3308.  
  3309.    ForegroundGray 100 div 1 exch sub setgray
  3310.    Bblly Height Bbury
  3311.      { Bbllx exch moveto
  3312.        { (a) show
  3313.          currentpoint
  3314.          pop Bburx gt
  3315.          {exit} if
  3316.        } loop
  3317.      } for
  3318.    } bind def
  3319.  
  3320.